Skip to content

prometheus query-exemplars

Get exemplars for given PromQL query and time range

Description

Returns a list of exemplars for a valid PromQL query for a specific time range

Synopsis

prometheus query-exemplars
    [--site <site>]
    [--cluster <cluster>]
    <query>
    [--start_time <start_time>]
    [--end_time <end_time>]

Arguments

site - (string)

     Site where this command will be executed
     Example: --site "site-1"
     Default: input.site      Attributes: optional

cluster - (string)

     Name of prometheus cluster
     Example: --cluster "prometheus-default"
     Default: prometheus-default      Attributes: optional

query - (string)

     Valid PromQL query
     Example: "test_exemplar_metric_total"
     Default: _None_      Attributes: required

start_time - (string)

     Start timestamp (inclusive, Should be provided in rfc3339 format)
     Example: --start_time "2015-07-01T20:10:51.781Z"
     Default: _None_      Attributes: optional

end_time - (string)

     End timestamp (inclusive, Should be provided in rfc3339 format)
     Example: --end_time "2015-07-01T20:10:51.781Z"
     Default: _None_      Attributes: optional

Examples

Input:

! prometheus query-exemplars --start_time "2021-10-19T20:10:51.781Z" --end_time "" "test_exemplar_metric_total"
Output:
{
  "status": "success",
  "data": null
}

Access Control

To use this command, you need access to the following:

Field Value
Action "read"
Service Type "prometheus"
Service Instance cluster
Namespace
Object Type
Object ID

Please see Access Control for details.