Metrics
Create a derived metric
Create a derived metric for the org. The metric name is supplied as the resource id, and the definition sets the formula and the queries the formula is computed from. Requires the Manage Tags for Metrics permission.
post/api/v2/metrics/derived-metrics
Request
- Base URLhttps://api.datadoghq.com
- Auth
- API key in header DD-API-KEY and API key in header DD-APPLICATION-KEY
- or OAuth 2Authorization code/oauth2/v1/authorizeToken URL/oauth2/v1/tokenScopesmetric_tags_write
- TypeScripthttps://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/metrics/derived-metrics/post.tsA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"data": {
"attributes": {
"definition": {
"formula": "a",
"queries": [
{
"data_source": "metrics",
"name": "a",
"query": "avg:system.cpu.user{*}"
}
]
}
},
"id": "my.derived.metric",
"type": "derived_metrics"
}
}Response
Created
Example response
{
"data": {
"attributes": {
"definition": {
"formula": "a",
"queries": [
{
"data_source": "metrics",
"name": "a",
"query": "avg:system.cpu.user{*}"
}
]
}
},
"id": "my.derived.metric",
"type": "derived_metrics"
}
}Changes
Changes to this operation have not been checked yet.