Skip to content

prometheus get-labels

Get list of label names

Description

Returns a list of label names

Synopsis

prometheus get-labels
    [--site <site>]
    [--cluster <cluster>]
    [<series_selector>]
    [--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

series_selector - (string)

     Series selector argument that selects the series from which labels are read
     Example: "up"
     Default: _None_      Attributes: optional, multiple allowed

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 get-labels --start_time "2021-10-19T20:10:51.781Z" --end_time "2021-10-20T20:10:51.781Z" "up"
Output:
{
  "status": "success",
  "data": ["__name__", "instance", "job"]
}

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.