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. write

Method write

  • HTTP request
  • Query parameters
  • Body parameters
  • Response

Writes metric data to Monitoring.

HTTP request

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

Query parameters

Parameter Description
folderId

Required. ID of the folder that the metric belongs to.

The maximum string length in characters is 50.

service

Required. ID of the service that the metric belongs to. Use service=custom for custom metrics.

The maximum string length in characters is 50.

Body parameters

{
  "ts": "string",
  "labels": "object",
  "metrics": [
    {
      "name": "string",
      "labels": "object",
      "type": "string",
      "ts": "string",
      "value": "number",
      "timeseries": [
        {
          "ts": "string",
          "value": "number"
        }
      ]
    }
  ]
}
Field Description
ts string (date-time)

Common timestamp for all metrics in RFC3339 text format.

labels object

Common labels for all metrics as key:value pairs.

metrics[] object

List of metrics.

metrics[].
name
string

Required. Name of the metric.

metrics[].
labels
object

Metric labels as key:value pairs.

metrics[].
type
string

Type of the metric. The default value is DGAUGE.

  • DGAUGE: Gauge with fractional values.
  • IGAUGE: Gauge with integer values.
  • COUNTER: Counter.
  • RATE: Rate.
metrics[].
ts
string (date-time)

Time point in RFC3339 text format. If it is not specified, the current time is used.

metrics[].
value
number (double)

Required. Metric value in the time point.

metrics[].
timeseries[]
object

List of several points.

metrics[].
timeseries[].
ts
string (date-time)

Time point in RFC3339 text format.

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

Metric value.

Response

HTTP Code: 200 - OK

{
  "writtenMetricsCount": "string",
  "errorMessage": "string"
}
Field Description
writtenMetricsCount string (int64)

Number of successfully written metrics.

errorMessage string

Error message if the writing failed.

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