Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex Monitoring
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Working with metrics
      • Getting a list of metrics
      • Downloading metrics
      • Writing custom metrics
      • Export metrics in Prometheus format
    • Working with dashboards
      • Creating dashboards
      • Copying dashboards
      • Adding widgets to a dashboard
      • Deleting widgets from a dashboard
      • Deleting dashboards
    • Working with alerts
      • Creating alerts
      • Creating notification channels
      • Deleting alerts
  • Concepts
    • Overview
    • Data model
    • Visualization
      • Overview
      • Query string
      • Widgets
      • Dashboards
    • Query language
    • Alerting
    • Data decimation
    • Deleting expired metrics (TTL)
    • Quotas and limits
  • Access management
  • Pricing policy
    • Current pricing policy
    • Archive
      • Policy before October 1, 2020
  • API reference
    • Authentication in the API
    • REST
      • Overview
      • MetricsData
        • Overview
        • read
        • write
        • prometheusMetrics
      • MetricsMeta
        • Overview
        • listLabelKeys
        • listLabelValues
        • listMetricNames
        • listMetrics
  • Questions and answers
  1. API reference
  2. REST
  3. MetricsData
  4. read

read method

  • HTTP request
  • Query parameters
  • Parameters in the request body
  • Response

Returns metric data.

HTTP request

POST https://monitoring.api.cloud.yandex.net/monitoring/v2/data/read

Query parameters

Parameter Description
folderId Required field. ID of the folder that the metric belongs to. Maximum string length: 50 characters.

Parameters in the request body

{
  "query": "string",
  "fromTime": "string",
  "toTime": "string",
  "downsampling": {
    "gridAggregation": "string",
    "gapFilling": "string",

    // `downsampling` only includes one of the `maxPoints`, `gridInterval`, or `disabled` fields
    "maxPoints": "string",
    "gridInterval": "string",
    "disabled": true,
    // end of the list of possible `downsampling` fields

  }
}
Field Description
query string

Required field. Query text. The syntax is described in Query language

fromTime string (date-time)

Required field. Interval starting point in RFC3339 format.

String in RFC3339 format.

toTime string (date-time)

Required field. Interval end point in RFC3339 format.

String in RFC3339 format.

downsampling object

Required field. Downsampling parameters.

downsampling.
gridAggregation
string
An aggregation function that is used for downsampling.

List of available aggregation functions that are used at downsampling.

  • MAX: Maximum.
  • MIN: Minimum.
  • SUM: Sum.
  • AVG: Average value. Default value.
  • LAST: Last value.
  • COUNT: Point count.
downsampling.
gapFilling
string
Parameters for filling in data gaps.

List of methods for filling in data gaps at downsampling.

  • NULL: Returns null as a metric value and timestamp as a timestamp. Default value.
  • NONE: Returns no values.
  • PREVIOUS: Returns a value from the previous time point.
downsampling.
maxPoints
string (int64)
downsampling includes only one of the fields maxPoints, gridInterval, or disabled

The maximum number of points to be returned in the response to the query.

The value must be greater than 10.

downsampling.
gridInterval
string (int64)
downsampling only includes one of the fields maxPoints, gridInterval, or disabled

The width of the time window (grid) in milliseconds. Used for downsampling. Points inside the window are combined into one using the aggregation function.

The value must be greater than 0.

downsampling.
disabled
boolean (boolean)
downsampling only includes one of the fields maxPoints, gridInterval, or disabled

Indicates that the data in the response to the query will be returned without downsampling.

Response

HTTP Code: 200 - OK

{
  "metrics": [
    {
      "name": "string",
      "labels": "object",
      "type": "string",
      "timeseries": {
        "timestamps": [
          "string"
        ],
        "doubleValues": [
          "number"
        ],
        "int64Values": [
          "string"
        ]
      }
    }
  ]
}
Field Description
metrics[] object

List of the metrics with time points.

metrics[].
name
string

Metric name.

metrics[].
labels
object

List of metric labels in key:value format.

metrics[].
type
string

Metric type.

  • DGAUGE: Numeric value. Set as a fractional number.
  • GAUGE: Numeric value. Set as an integer.
  • COUNTER: Counter.
  • RATE: Derivative.
metrics[].
timeseries
object

Metric values.

metrics[].
timeseries.
timestamps[]
string (int64)

List of time points in the format of Unix milliseconds.

metrics[].
timeseries.
doubleValues[]
number (double)

List of fractional metric values.

metrics[].
timeseries.
int64Values[]
string (int64)

List of integer metric values. Only available for metrics of the IGAUGE type.

In this article:
  • HTTP request
  • Query parameters
  • Parameters in the request body
  • Response
Language
Careers
Privacy policy
Terms of use
© 2021 Yandex.Cloud LLC