Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Monitoring
  • Getting started
  • Access management
  • Pricing policy
  • Terraform reference
    • API authentication
      • Overview
        • Overview
        • read
        • write
        • prometheusMetrics
  • Release notes

In this article:

  • HTTP request
  • Query parameters
  • Request body parameters
  • Response
  1. API reference
  2. REST
  3. MetricsData
  4. write

Write method

Written by
Yandex Cloud
Updated at May 5, 2025
  • HTTP request
  • Query parameters
  • Request body parameters
  • Response

Writes metric data.

HTTP requestHTTP request

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

Query parametersQuery parameters

Parameter Description
folderId This is a required field. Metric folder ID. The maximum string length is 50 characters.
service This is a required field. ID of the service associated with the metric. Use service=custom for custom metrics. The maximum string length is 50 characters.

Request body parametersRequest 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)

Timestamp common for all metrics in the RFC3339 format.

labels object

List of labels in key:value format, common for all metrics.

metrics[] object

List of metrics.

metrics[].
name
string

This is a required field. Metric name.

metrics[].
labels
object

Metric labels in key:value format.

metrics[].
type
string

Metric type. Default value: DGAUGE.

  • DGAUGE: Numeric value. Set as a fraction.
  • IGAUGE: Numeric value. Set as an integer.
  • COUNTER: Counter.
metrics[].
ts
string (date-time)

Timestamp in RFC3339 format. If not specified, the current time will be used.

metrics[].
value
number (double)

This is a required field. Metric value in the specified point.

metrics[].
timeseries[]
object

Point list.

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

Timestamp in RFC3339 format.

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

Metric value in the specified point.

ResponseResponse

HTTP Code: 200 - OK

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

Number of successfully written metrics.

errorMessage string

Error message if a write fails.

Was the article helpful?

Previous
read
Next
prometheusMetrics
© 2025 Direct Cursus Technology L.L.C.