Prometheus label values API: add rest action#145098
Merged
felixbarny merged 6 commits intoelastic:mainfrom Mar 27, 2026
Merged
Conversation
Implements the REST handler for GET /_prometheus/api/v1/label/{name}/values,
wiring together the plan builder and response listener. Registers the action
in PrometheusPlugin and adds integration tests.
…es-api-rest-action
…rometheusLabelValuesRestIT The FeatureFlag enum does not have a PROMETHEUS_FEATURE_FLAG constant. The endpoint is already gated by xpack.prometheus.enabled (default: true), matching the pattern used by the other prometheus REST IT tests.
…_size When limit=0 (Prometheus "disabled" semantics), always emit an explicit LIMIT Integer.MAX_VALUE node so ESQL silently caps to its own result_truncation_max_size setting (default 10 000) instead of adding a default limit of 1 000 with a "No limit defined" warning. Change the default from 10 000 to 0 to match Prometheus semantics where omitting the parameter means no explicit limit.
Collaborator
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
This was referenced Mar 27, 2026
kkrik-es
approved these changes
Mar 27, 2026
mamazzol
pushed a commit
to mamazzol/elasticsearch
that referenced
this pull request
Mar 30, 2026
Implements the REST handler for GET /_prometheus/api/v1/label/{name}/values,
wiring together the plan builder and response listener. Registers the action
in PrometheusPlugin and adds integration tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-creation of #144958, which was reverted in 08162c1 due to a compilation issue (
PROMETHEUS_FEATURE_FLAGreferenced inPrometheusLabelValuesRestITno longer existing on main). That reference has been removed.This PR also improves the handling of
limit=0(Prometheus semantics for "disabled"): instead of omitting the ESQLLIMITnode entirely — which caused ESQL to silently add a default limit of 1 000 with a "No limit defined" warning — we now emitLIMIT Integer.MAX_VALUE, letting ESQL silently cap toesql.query.result_truncation_max_size(default 10 000) without a warning. The default for the parameter is changed from 10 000 to 0 to match Prometheus semantics where omitting the parameter means no explicit limit.Adds
PrometheusLabelValuesRestAction, the REST handler forGET /_prometheus/api/v1/label/{name}/values. It wires together the plan builder and response listener from the prerequisite PRs and registers the action with the Prometheus plugin. Integration tests are covered byPrometheusLabelValuesRestIT.This is part of a stack implementing the Prometheus label values API endpoint:
Stacking order