Write method
Written by
Updated at March 14, 2023
Writes data about metrics.
HTTP request
POST https://monitoring.api.cloud.yandex.net/monitoring/v2/data/write
Query parameters
Parameter | Description |
---|---|
folderId | Required field. ID of the folder that the metric belongs to. Maximum string length: 50 characters. |
service | Required field. ID of the service that the metric belongs to. Use service=custom for custom metrics. Maximum string length: 50 characters. |
Parameters in the request body
{
"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 RFC3339 format. |
labels | object List of labels in |
metrics[] | object List of metrics. |
metrics[]. name |
string Required field. Metric name. |
metrics[]. labels |
object List of metric labels in |
metrics[]. type |
string Type of metric. Default value:
|
metrics[]. ts |
string (date-time) Timestamp in RFC3339 format. If not specified, the current time is used. |
metrics[]. value |
number (double) Required field. Metric value in the specified point. |
metrics[]. timeseries[] |
object List of multiple points. |
metrics[]. timeseries[]. ts |
string (date-time) Point in time 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 metrics that are written successfully. |
errorMessage | string Error message returned if a write fails. |