Skip to content

prometheus get-series

Get time series for given label set

Description

Returns the list of time series that match a certain label set.

Synopsis

prometheus get-series
    [--site <site>]
    [--cluster <cluster>]
    [--start_time <start_time>]
    [--end_time <end_time>]
    <series_selector>

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

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

series_selector - (string)

     Series selector argument that selects the series to return.
     Example: "up"
     Default: _None_      Attributes: required, multiple allowed

Examples

Input:

! prometheus get-series --start_time "2021-10-19T20:10:51.781Z" --end_time "2021-10-20T20:10:51.781Z" "up"
Output:
{
  "status": "success",
  "data": [
    {
      "__name__": "up",
      "instance": "localhost:1234",
      "job": "kafka"
    },
    {
      "__name__": "up",
      "instance": "localhost:9090",
      "job": "prometheus"
    },
    {
      "__name__": "up",
      "instance": "localhost:9100",
      "job": "node-exporter"
    }
  ]
}

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.