Skip to content

Query Metrics


Overview

CloudAEye metrics service provides programmatic access and querying capabilities using Prometheus Query Language for metrics. This topic describes how user may query metrics.

⚓ Prerequisites

User is required to create a metrics service.

Query Metrics

CloudAEye support metrics query using the Prometheus Query Language (PromQL). Refer to official Prometheus documentation, Querying Prometheus, for more information about PromQL.

User may use the following REST APIs to query metrics from Prometheus. Please use AWS Signature Version 4 signing process while using the REST APIs.

GetLabels

Retrieves the labels associated with a time series.

GET {serviceEndpoint}/api/v1/labels
GET {serviceEndpoint}/api/v1/label/label-name/values

Query Parameters:

  • start=<rfc3339 | unix_timestamp> - (Optional) Start timestamp
  • end=<rfc3339 | unix_timestamp> - (Optional) End timestamp

GetMetricMetadata

Metadata about metrics that are currently being scraped from targets.

GET {serviceEndpoint}/api/v1/metadata

Query Parameters:

  • The maximum number of metrics to return - limit=<number>
  • metric=<string> - A metric name to filter metadata for. If you leave this empty, all metric metadata is retrieved.

GetSeries

Retrieves list of time series that match a certain label set

GET {serviceEndpoint}/api/v1/series

Query Parameters:

  • match[]=<series_selector> - Repeated series selector argument that selects the series to return. At least one match[] argument must be provided.
  • start=<rfc3339 | unix_timestamp> - (Optional) Start timestamp
  • end=<rfc3339 | unix_timestamp> - (Optional) End timestamp

QueryMetrics

Evaluates an instant query at a single point in time or over a range of time.

GET {serviceEndpoint}/api/v1/query
GET {serviceEndpoint}/api/v1/query_range

Query Parameters:

  • query=<string> - A Prometheus expression query string. Used in both query and query_range.
  • time=<rfc3339 | unix_timestamp> - (Optional) Evaluation timestamp if you are using the query for an instant query at a single point in time.
  • timeout=<duration> - (Optional) Evaluation timeout. Defaults to and is capped by the value of the -query.timeout flag. Used in both query and query_range.
  • start=<rfc3339 | unix_timestamp> - Start timestamp if you are using query_range to query for a range of time.
  • end=<rfc3339 | unix_timestamp> - End timestamp if you are using query_range to query for a range of time.
  • step=<duration | float> - Query resolution step width in duration format or as a float number of seconds. Use only if you are using query_range to query for a range of time, and required for such queries.

Duration Is a number, followed by one of the following units

  • ms - milliseconds
  • s - seconds
  • m - minutes
  • h - hours
  • d - days, assuming a day always has 24h
  • w - weeks, assuming a week always has 7d
  • y - years, assuming a year always has 365d

Grafana Dashboards

CloudAEye SaaS supports Grafana. User may use the Grafana Dashboards the view the metrics already injected in Prometheus.