Conversation
The schema compiler requires every Request interface to have a @doc_id annotation pointing to a registered entry in _doc_ids/table.csv. The five prometheus request files were missing these, causing CI to fail. Added #TODO placeholder URLs following the same pattern used by other new 9.4.0 endpoints (e.g. the reindex management APIs).
af4f50f to
ec044ac
Compare
|
Following you can find the validation changes against the target branch for the APIs.
You can validate these APIs yourself by using the |
| /** | ||
| * Get label names. | ||
| * | ||
| * Return a list of label names that match a certain set of selectors. |
There was a problem hiding this comment.
| * Return a list of label names that match a certain set of selectors. | |
| * Return a sorted list of label names that match a certain set of selectors. |
since the endpoint java doc in the server code specifies that the list is sorted we can also add it here
| */ | ||
| 'match[]'?: string[] | ||
| /** | ||
| * The start of the time range. Defaults to `now - 24h`. |
There was a problem hiding this comment.
we should use the server default annotation
There was a problem hiding this comment.
from the server code it looks like it's "end-24h" (which yes it's "now-24h" in case both are empty, but still)
| */ | ||
| start?: string | ||
| /** | ||
| * The end of the time range. Defaults to now. |
There was a problem hiding this comment.
we should use the server default annotation
|
|
||
| export class Response { | ||
| /** @codegen_name body */ | ||
| body: UserDefinedValue |
There was a problem hiding this comment.
is it really completely unmappable? I'm looking at the server code and it seems like there is some structure, there's also the error case which we could map using the exceptions field.
| */ | ||
| query: string | ||
| /** | ||
| * The evaluation timestamp. Defaults to the current server time. |
There was a problem hiding this comment.
we should use the server default annotation (default to now)
There was a problem hiding this comment.
this one is likely missing the body, the request_media_type and the response_media_type. from the server code it's not immediately clear what's expecting, let's gather more info first.
|
|
||
| export class Response { | ||
| /** @codegen_name body */ | ||
| body: UserDefinedValue |
There was a problem hiding this comment.
I think this one just returns and empty response, from reading the server code, but again, not super clear, need more info.
| ] | ||
| path_parts: { | ||
| /** | ||
| * An index pattern that restricts the query to a specific index. |
| query_parameters: { | ||
| /** | ||
| * Repeated series selector arguments that select the series to return. | ||
| * @codegen_name match | ||
| */ | ||
| 'match[]': string[] | ||
| /** | ||
| * The start of the time range. Defaults to `now - 24h`. | ||
| */ | ||
| start?: string | ||
| /** | ||
| * The end of the time range. Defaults to now. | ||
| */ | ||
| end?: string | ||
| /** | ||
| * The maximum number of results to return. `0` means no limit. | ||
| */ | ||
| limit?: integer | ||
| } |
There was a problem hiding this comment.
same comments in labels request apply
|
|
||
| export class Response { | ||
| /** @codegen_name body */ | ||
| body: UserDefinedValue |
| * | ||
| * Return a list of label names that match a certain set of selectors. | ||
| * @rest_spec_name prometheus.labels | ||
| * @availability stack since=9.4.0 stability=experimental visibility=public |
There was a problem hiding this comment.
We've now got "tech_preview" available per #6312
| * @availability stack since=9.4.0 stability=experimental visibility=public | |
| * @availability stack since=9.4.0 stability=tech_preview visibility=public |
| * Return a list of label names that match a certain set of selectors. | ||
| * @rest_spec_name prometheus.labels | ||
| * @availability stack since=9.4.0 stability=experimental visibility=public | ||
| * @availability serverless stability=experimental visibility=public |
There was a problem hiding this comment.
| * @availability serverless stability=experimental visibility=public | |
| * @availability serverless stability=tech_preview visibility=public |
| * | ||
| * Evaluate a PromQL expression at a single point in time. | ||
| * @rest_spec_name prometheus.query | ||
| * @availability stack since=9.4.0 stability=experimental visibility=public |
There was a problem hiding this comment.
| * @availability stack since=9.4.0 stability=experimental visibility=public | |
| * @availability stack since=9.4.0 stability=tech_preview visibility=public |
| * Evaluate a PromQL expression at a single point in time. | ||
| * @rest_spec_name prometheus.query | ||
| * @availability stack since=9.4.0 stability=experimental visibility=public | ||
| * @availability serverless stability=experimental visibility=public |
There was a problem hiding this comment.
| * @availability serverless stability=experimental visibility=public | |
| * @availability serverless stability=tech_preview visibility=public |
| * Evaluate a PromQL expression over a time range. | ||
| * @rest_spec_name prometheus.query_range | ||
| * @availability stack since=9.4.0 stability=experimental visibility=public | ||
| * @availability serverless stability=experimental visibility=public |
There was a problem hiding this comment.
| * @availability serverless stability=experimental visibility=public | |
| * @availability serverless stability=tech_preview visibility=public |
| * | ||
| * Evaluate a PromQL expression over a time range. | ||
| * @rest_spec_name prometheus.query_range | ||
| * @availability stack since=9.4.0 stability=experimental visibility=public |
There was a problem hiding this comment.
| * @availability stack since=9.4.0 stability=experimental visibility=public | |
| * @availability stack since=9.4.0 stability=tech_preview visibility=public |
| * Accepts a Prometheus remote write request (protobuf-encoded) and indexes the | ||
| * time series data into Elasticsearch. | ||
| * @rest_spec_name prometheus.remote_write | ||
| * @availability stack since=9.4.0 stability=experimental visibility=public |
There was a problem hiding this comment.
| * @availability stack since=9.4.0 stability=experimental visibility=public | |
| * @availability stack since=9.4.0 stability=tech_preview visibility=public |
| * time series data into Elasticsearch. | ||
| * @rest_spec_name prometheus.remote_write | ||
| * @availability stack since=9.4.0 stability=experimental visibility=public | ||
| * @availability serverless stability=experimental visibility=public |
There was a problem hiding this comment.
| * @availability serverless stability=experimental visibility=public | |
| * @availability serverless stability=tech_preview visibility=public |
| * | ||
| * Return the list of time series that match a certain set of selectors. | ||
| * @rest_spec_name prometheus.series | ||
| * @availability stack since=9.4.0 stability=experimental visibility=public |
There was a problem hiding this comment.
| * @availability stack since=9.4.0 stability=experimental visibility=public | |
| * @availability stack since=9.4.0 stability=tech_preview visibility=public |
| * Return the list of time series that match a certain set of selectors. | ||
| * @rest_spec_name prometheus.series | ||
| * @availability stack since=9.4.0 stability=experimental visibility=public | ||
| * @availability serverless stability=experimental visibility=public |
There was a problem hiding this comment.
| * @availability serverless stability=experimental visibility=public | |
| * @availability serverless stability=tech_preview visibility=public |
| * Ingest Prometheus remote write data. | ||
| * | ||
| * Accepts a Prometheus remote write request (protobuf-encoded) and indexes the | ||
| * time series data into Elasticsearch. |
There was a problem hiding this comment.
Not mandatory, but might be nice to link to the narrative docs:
| * time series data into Elasticsearch. | |
| * time series data into Elasticsearch. For an overview, refer to [Prometheus remote write endpoint](https://www.elastic.co/docs/manage-data/data-store/data-streams/tsds-ingest-prometheus-remote-write). |
Summary
Adds a new
prometheus/namespace with five endpoints for the Prometheus HTTP API compatibility layer introduced in Elasticsearch 9.4.0. All are Tech Preview (stability=experimental,visibility=public) and available in both stack and serverless.prometheus.remote_write/_prometheus/api/v1/write,/_prometheus/metrics/{dataset}/api/v1/write,/_prometheus/metrics/{dataset}/{namespace}/api/v1/writeprometheus.query/_prometheus/api/v1/query,/_prometheus/{index}/api/v1/queryprometheus.query_range/_prometheus/api/v1/query_range,/_prometheus/{index}/api/v1/query_rangeprometheus.series/_prometheus/api/v1/series,/_prometheus/{index}/api/v1/seriesprometheus.labels/_prometheus/api/v1/labels,/_prometheus/{index}/api/v1/labelsAll response bodies are typed as
UserDefinedValue(opaque) since the Prometheus HTTP API JSON envelope is complex. Theremote_writerequest body is protobuf — norequest_media_typeis declared as there is no protobuf entry in theMediaTypeenum; a follow-up can add one if needed.ES PRs: elastic/elasticsearch#141957, elastic/elasticsearch#145321, elastic/elasticsearch#144416, elastic/elasticsearch#144494, elastic/elasticsearch#144952 (all labeled
v9.4.0)Test plan
prometheusnamespacestability=experimentalandvisibility=publicfor both stack and serverless on all fiveremote_writehas three URL variants; all others have twoserieshasmatch[]as required;labelshasmatch[]as optionalquery_rangehasstart,end,stepas required query params