Skip to content

Prometheus label values API: add plan builder#144956

Merged
felixbarny merged 3 commits intoelastic:mainfrom
felixbarny:prometheus-label-values-api-plan-builder
Mar 26, 2026
Merged

Prometheus label values API: add plan builder#144956
felixbarny merged 3 commits intoelastic:mainfrom
felixbarny:prometheus-label-values-api-plan-builder

Conversation

@felixbarny
Copy link
Copy Markdown
Member

@felixbarny felixbarny commented Mar 25, 2026

Adds PrometheusLabelValuesPlanBuilder and PrometheusPlanBuilderUtils, which translate a Prometheus label values API request (label name, match selectors, time range, limit) into a LogicalPlan that can be executed via ES|QL. The plan builder supports both the __name__ special label (via MetricsInfo) and regular label columns. It is covered by unit tests in PrometheusLabelValuesPlanBuilderTests.

This is part of a stack implementing the Prometheus label values API endpoint:

Stacking order

Builds the ESQL query plan for the Prometheus label values API, supporting
both the `__name__` special label (via MetricsInfo) and regular label
columns.
@felixbarny felixbarny self-assigned this Mar 25, 2026
@elasticsearchmachine elasticsearchmachine added Team:StorageEngine external-contributor Pull request authored by a developer outside the Elasticsearch team labels Mar 25, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

@felixbarny felixbarny requested review from kkrik-es and sidosera March 26, 2026 07:20
Copy link
Copy Markdown
Member Author

@felixbarny felixbarny Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will disappear from the PR once #144493 is merged.

@felixbarny felixbarny merged commit 039512b into elastic:main Mar 26, 2026
40 checks passed
@felixbarny felixbarny deleted the prometheus-label-values-api-plan-builder branch March 26, 2026 18:09
mamazzol pushed a commit to mamazzol/elasticsearch that referenced this pull request Mar 30, 2026
Builds the ESQL query plan for the Prometheus label values API, supporting
both the `__name__` special label (via MetricsInfo) and regular label
columns.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external-contributor Pull request authored by a developer outside the Elasticsearch team >non-issue :StorageEngine/PromQL PromQL support for Elastic Team:StorageEngine v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants