I have a promql which is giving me the metric result as a whole from the server, but I am interested in filtering and getting results of a specific value, but I am not sure what can be the label name for that value, if I can see all the available names I will be able to at least hit it using trial and error, but without the label names, I am not able to do anything.
While PromQL doesn't provide functionality for returning all the available label names, Prometheus querying API provides such functionality via /api/v1/labels handler.
This handler supports optional start
and end
query args, which may be used for limiting time range for the returned label names. It also supports match[]
query args, which may be used for additional filtering on time series. For example, request to /api/v1/labels?match[]=foo{bar="baz"}
would return only label names for time series matching foo{bar="baz"}
time series selector. See these docs for more details.