v1
latestOpenAPI 3.0.02026-07-141,4077,1665.2 MBMetrics
Create a tag indexing rule
Create a tag indexing rule for the org. rule_order is assigned server-side as max+1 among existing rules; use the reorder endpoint to change the evaluation order. Requires the Manage Tags for Metrics permission.
post/api/v2/metrics/tag-indexing-rules
Request body
Example request
{
"data": {
"attributes": {
"metric_name_matches": [
"dd.test.*"
],
"name": "my-indexing-rule",
"options": {
"data": {
"dynamic_tags": {
"queried_tags_window_seconds": 3600
},
"manage_preexisting_metrics": true,
"metric_match": {
"queried_window_seconds": 3600
}
},
"version": 1
},
"tags": [
"env",
"service"
]
},
"type": "tag_indexing_rules"
}
}Response
Created
Example response
{
"data": {
"attributes": {
"created_at": "2024-01-15T12:00:00.000Z",
"created_by_handle": "user@datadoghq.com",
"ignored_metric_name_matches": [
"dd.test.excluded.*"
],
"metric_name_matches": [
"dd.test.*"
],
"modified_at": "2024-01-15T12:00:00.000Z",
"modified_by_handle": "user@datadoghq.com",
"name": "my-indexing-rule",
"options": {
"data": {
"dynamic_tags": {
"queried_tags_window_seconds": 3600
},
"manage_preexisting_metrics": true,
"metric_match": {
"queried_window_seconds": 3600
}
},
"version": 1
},
"rule_order": 1,
"tags": [
"env",
"service"
]
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "tag_indexing_rules"
}
}