Method read

Returns metric data from Monitoring.

HTTP request

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

Query parameters

Parameter Description
folderId Required. ID of the folder that the metric belongs to. The maximum string length in characters is 50.

Body parameters

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

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

  }
}
Field Description
query string

Required. Query text.

fromTime string (date-time)

Required. The beginning of the time interval, in RFC3339 text format.

String in RFC3339 text format.

toTime string (date-time)

Required. The end of the time interval, in RFC3339 text format.

String in RFC3339 text format.

downsampling object

Required. Downsampling parameters.

List of available aggregate functions for downsampling.

downsampling.
gridAggregation
string
Function that is used for downsampling.

List of available aggregate functions for downsampling.

  • MAX: Max value.
  • MIN: Min value.
  • SUM: Sum of values.
  • AVG: Average value.
  • LAST: Last value.
  • COUNT: Total count of points.
downsampling.
gapFilling
string
Parameters for filling gaps in data.

List of available gap filling policy for downsampling.

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

Maximum number of points to be returned.

Value must be greater than 10.

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

Time interval (grid) for downsampling in milliseconds. Points in the specified range are aggregated into one time point.

Value must be greater than 0.

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

Disable 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 metrics with timeseries.

metrics[].
name
string

Name of the metric.

metrics[].
labels
object

List of metric labels as key:value pairs.

metrics[].
type
string

Type of the metric.

  • DGAUGE: Gauge with fractional values.
  • IGAUGE: Gauge with integer values.
  • COUNTER: Counter.
  • RATE: Rate.
metrics[].
timeseries
object

Metric values.

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

List of timestamps as unix-time milliseconds.

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

List of double values.

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

List of int64 values. Only for IGAUGE metric type.