devops:monitoring:datadog:metrics_api
This is an old revision of the document!
Metrics API in Datadog
The Metrics API in Datadog allows you to interact with and manage your metric data programmatically. With this API, you can submit custom metrics, retrieve metric data, manage tags associated with your metrics, and more. The API provides access to the full range of Datadog's metric-related features, making it a powerful tool for automating metric data management and integration.
1. Submitting Custom Metrics
You can submit custom metrics to Datadog through the Metrics API using the `POST` method. Custom metrics allow you to track data that is specific to your application or infrastructure.
- Endpoint: `https://api.datadoghq.com/api/v1/series`
- Request Method: `POST`
- Parameters:
- `series`: A list of metrics to be submitted. Each metric consists of the following fields:
- `metric`: The name of the metric.
- `points`: A list of timestamp-value pairs, representing the metric data points.
- `tags`: A list of tags associated with the metric.
- `type`: The type of the metric (e.g., `gauge`, `count`, `rate`).
- `host`: The host associated with the metric.
- `device`: The device associated with the metric (optional).
- Example Request:
```json
{
"series": [
{
"metric": "custom.metric",
"points": [[<timestamp>, <value>]],
"tags": ["env:prod", "app:web"],
"type": "gauge",
"host": "web-server-1"
}
]
}
devops/monitoring/datadog/metrics_api.1739542816.txt.gz · Last modified: 2025/02/14 14:20 by 85.219.17.206
