Write method
Written by
Updated at April 14, 2025
Writes metric data.
HTTP request
POST https://monitoring.api.cloud.yandex.net/monitoring/v2/data/write
Query 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 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 |
metrics[] | object List of metrics. |
metrics[]. name |
string This is a required field. Metric name. |
metrics[]. labels |
object Metric labels in |
metrics[]. type |
string Metric type. Default value:
|
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. |
Response
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. |