Yandex Cloud
  • Services
  • Solutions
  • Why Yandex Cloud
  • Pricing
  • Documentation
  • Contact us
Get started
Language / Region
© 2022 Yandex.Cloud LLC
Yandex Monitoring
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Working with metrics
      • Delivering Linux system metrics
      • Delivering custom application metrics
      • Delivering metrics from HAProxy and other third-party applications
      • Delivering metrics from hosts outside Yandex Cloud
      • Writing custom metrics via the API
      • Getting a list of metrics
      • Downloading metrics
      • Exporting 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
    • Service overview
    • Data model
    • Visualization
      • Overview
      • Query string
      • Widgets
      • Dashboards
    • Transmitting metrics
      • Agent for delivering metrics
        • Overview
        • Installation and startup
        • Configuration
        • Best practices for using the agent
    • 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
    • API authentication
    • REST
      • Overview
      • MetricsData
        • Overview
        • read
        • write
        • prometheusMetrics
      • MetricsMeta
        • Overview
        • listLabelKeys
        • listLabelValues
        • listMetricNames
        • listMetrics
  • Metric reference
  • Questions and answers
    • General questions
    • Navigation
    • Metric collection and export
    • Metrics and units of measure
    • Alerts / notifications
    • All questions on the same page
  1. API reference
  2. REST
  3. MetricsData
  4. write

Method write

Written by
Yandex Cloud
  • 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.

Was the article helpful?

Language / Region
© 2022 Yandex.Cloud LLC
In this article:
  • HTTP request
  • Query parameters
  • Body parameters
  • Response