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:
|
Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>
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 |
Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>
|
@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>
Description
Adds a first-class Elasticsearch backend provider.
The provider uses Delta Proxy Cache for aggregation-only
_searchand_msearchrequests withsize: 0, one inclusive range over the configured timestamp field, and one top-level fixed-intervaldate_histogramover that field. It normalizes the range in the DPC cache key, rewrites range and histogram bounds for missing extents, and preserves each histogram bucket's JSON, including nested metric aggregations.The default timestamp field is
@timestamp, withbackends.<name>.elasticsearch.timestamp_fieldavailable for other indices. Query shapes that cannot be merged without changing Elasticsearch semantics fall back to Object Proxy Cache with the exact request body in the key. This includes document-hit searches, calendar or shifted bucket intervals, multiple ranges or top-level aggregations, and unsupported_msearchrequests. Write-oriented methods are proxied without caching.The developer environment includes Elasticsearch, generated recent and older log data, Kibana routed through Trickster, and seeded Kibana data-view/search/dashboard objects.
Fixes #7.
Type of Change
AI Disclosure
Validation
go test ./pkg/backends/elasticsearch/... ./pkg/backends/options ./pkg/backends/providers/... ./pkg/proxy/handlers/... ./pkg/config/validate -count=1go test -race ./pkg/backends/elasticsearch/... -count=1go test ./pkg/backends/elasticsearch -run '^TestQueryHandlerFallbackCacheSeparatesTimeRanges$' -count=20go tool golangci-lint run --timeout 5m ./pkg/backends/elasticsearch/...go test -run '^$' ./...git diff --check