feat: add elasticsearch backend provider#1052
Conversation
|
@houyuwushang Thanks for this! One thing we'd like to see is an updated developer environment docker-compose.yml that includes:
|
234ad83 to
790aafb
Compare
|
Updated this PR to include the developer Elasticsearch environment requested here:
Validated with:
I could not run |
@houyuwushang this comment appears to be from your AI agent. While it's OK to use agentic AI, you will need to install docker locally, run the docker compose and visually verify the new functionality for the developer environment. As reviewers, we are using and verifying changes with the developer environment; and other contributors will expect it to work out of the box without any additional manual steps. My initial tests of the updated docker compose indicate that the new Elasticsearch containers are running, but the Kibana instance prints a lot of errors and does not fully integrate with the trickster backend. For example, the Kibana UX does not show the |
|
@jranson Thanks, that feedback is fair. To clarify the earlier validation note: the machine I used for the first update did not have a Docker-capable developer environment available, so I should have moved the runtime validation to a suitable environment before posting that update. I have now done that and pushed That update adds:
Additional validation performed on a Docker-capable Linux environment:
GitHub checks are green on the updated head as well. |
Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>
Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>
Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>
Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>
71a49c4 to
d0ab963
Compare
|
I took another pass at the DPC boundary before review and found a correctness issue: a partial final date-histogram bucket could be treated as complete and then reused from cache. The update admits only complete, aligned buckets from a single required timestamp range. Unsupported histogram shapes use the exact-request OPC path; incomplete Elasticsearch responses are rejected and not cached. I also preserved aggregation metadata and reconstructed I rebased the branch onto current |
Description
Adds a first-class Elasticsearch backend provider.
Delta Proxy Cache is used only for aggregation requests whose date-histogram buckets can be merged independently:
size: 0, one mandatory range on the configured timestamp field, one top-leveldate_histogram, complete aligned buckets, ascending key order, and no pipeline or scripted aggregations. Supported intervals are fixed intervals and UTC calendar minute/hour/day intervals. Partial edge buckets, response-shaping URL options, and unsupported query shapes fall back to Object Proxy Cache using the exact request as the cache key. Incomplete Elasticsearch responses are rejected by the DPC modeler and are not cached.The provider preserves each bucket's JSON and aggregation metadata, including nested metrics, and reconstructs
hits.totalfrom the returned buckets. The timestamp field defaults to@timestampand can be changed withbackends.<name>.elasticsearch.timestamp_field. Elasticsearch targets are also registered with the Basic authenticator observer foruser_routerconfigurations.The developer environment adds Elasticsearch, generated log data, Kibana routed through Trickster, and seeded data-view, saved-search, log-volume visualization, and dashboard objects.
Fixes #7.
Type of Change
AI Disclosure
Validation
go test ./pkg/backends/elasticsearch/... ./pkg/backends/options ./pkg/backends/providers/... ./pkg/backends/alb ./pkg/proxy/authenticator/registry ./pkg/proxy/handlers/elasticsearch ./pkg/config/validate -count=1go test ./pkg/backends/elasticsearch -run '^TestQueryHandlerCachesOnlyCompleteHistogramBuckets$' -count=20go test -race ./pkg/backends/elasticsearch/... ./pkg/proxy/authenticator/registry -count=1go vet ./pkg/backends/elasticsearch/... ./pkg/proxy/authenticator/registrygo tool golangci-lint run --timeout 5m ./pkg/backends/elasticsearch/... ./pkg/proxy/authenticator/registrygo test -run '^$' ./...git diff --check origin/main...HEADAn earlier revision was exercised through a clean Linux Docker Compose startup, including Elasticsearch/Kibana, Trickster-backed count and date-histogram requests, and the seeded Kibana objects. The log-volume visualization added in this audit has been structurally validated but has not been rerun in Docker.