tag_indexing_rules
Creates, updates, deletes, gets or lists a tag_indexing_rules resource.
Overview
| Name | tag_indexing_rules |
| Type | Resource |
| Id | datadog.metrics.tag_indexing_rules |
Fields
The following fields are returned by SELECT queries:
- get_tag_indexing_rule
- list_tag_indexing_rules_for_metric
- list_tag_indexing_rules
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier (UUID) of the tag indexing rule. (example: 00000000-0000-0000-0000-000000000001) |
attributes | object | Attributes of a tag indexing rule. |
type | string | The tag indexing rule resource type. (tag_indexing_rules) (default: tag_indexing_rules, example: tag_indexing_rules) |
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier (UUID) of the tag indexing rule. (example: 00000000-0000-0000-0000-000000000001) |
attributes | object | Attributes of a tag indexing rule. |
type | string | The tag indexing rule resource type. (tag_indexing_rules) (default: tag_indexing_rules, example: tag_indexing_rules) |
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier (UUID) of the tag indexing rule. (example: 00000000-0000-0000-0000-000000000001) |
attributes | object | Attributes of a tag indexing rule. |
type | string | The tag indexing rule resource type. (tag_indexing_rules) (default: tag_indexing_rules, example: tag_indexing_rules) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_tag_indexing_rule | select | id | Get a single tag indexing rule by its UUID. | |
list_tag_indexing_rules_for_metric | select | metric_name | List the tag indexing rules that apply to a given metric, sorted by rule_order.<br />Matching is performed server-side using each rule's metric_name_matches glob patterns. | |
list_tag_indexing_rules | select | page[limit], page[offset], search | List tag indexing rules for an org, sorted by rule_order, with offset/limit pagination. | |
create_tag_indexing_rule | insert | data | Create a tag indexing rule for the org. rule_order is assigned server-side as max+1<br />among existing rules; use the reorder endpoint to change the evaluation order.<br />Requires the Manage Tags for Metrics permission. | |
update_tag_indexing_rule | replace | id, data | Partially update a tag indexing rule. Fields omitted from the request body are left unchanged.<br />Setting rule_order to a value already used by another rule returns 409; use the<br />reorder endpoint for atomic re-sequencing. Requires the Manage Tags for Metrics permission. | |
delete_tag_indexing_rule | delete | id | Soft-delete a tag indexing rule. Idempotent: returns 204 whether the rule existed or was already deleted.<br />Remaining rules in the org are automatically re-sequenced to keep rule_order dense and 1-based.<br />Requires the Manage Tags for Metrics permission. | |
reorder_tag_indexing_rules | exec | data | Atomically re-sequence the tag indexing rules for an org to match the supplied list of rule UUIDs.<br />The server assigns rule_order 1, 2, … matching each rule UUID by position in the list.<br />The UUIDs of all active rules must be provided; omitting any active rule UUID returns a 400 error.<br />Requires the Manage Tags for Metrics permission. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
id | string | ID of the tag indexing rule. (example: 00000000-0000-0000-0000-000000000001) |
metric_name | string | The name of the metric. (example: dist.http.endpoint.request) |
site | string | The Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both. |
page[limit] | integer (int64) | Page size (1–1000, default 100). |
page[offset] | integer (int64) | Page offset from the start of the list (default 0). |
search | string | Substring filter on rule name. |
SELECT examples
- get_tag_indexing_rule
- list_tag_indexing_rules_for_metric
- list_tag_indexing_rules
Get a single tag indexing rule by its UUID.
SELECT
id,
attributes,
type
FROM datadog.metrics.tag_indexing_rules
WHERE id = '{{ id }}' -- required
;
List the tag indexing rules that apply to a given metric, sorted by rule_order.<br />Matching is performed server-side using each rule's metric_name_matches glob patterns.
SELECT
id,
attributes,
type
FROM datadog.metrics.tag_indexing_rules
WHERE metric_name = '{{ metric_name }}' -- required
;
List tag indexing rules for an org, sorted by rule_order, with offset/limit pagination.
SELECT
id,
attributes,
type
FROM datadog.metrics.tag_indexing_rules
WHERE page[limit] = '{{ page[limit] }}'
AND page[offset] = '{{ page[offset] }}'
AND search = '{{ search }}'
;
INSERT examples
- create_tag_indexing_rule
- Manifest
Create a tag indexing rule for the org. rule_order is assigned server-side as max+1<br />among existing rules; use the reorder endpoint to change the evaluation order.<br />Requires the Manage Tags for Metrics permission.
INSERT INTO datadog.metrics.tag_indexing_rules (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data
;
# Description fields are for documentation purposes
- name: tag_indexing_rules
props:
- name: data
description: |
Data object for creating a tag indexing rule.
value:
attributes:
exclude_tags_mode: {{ exclude_tags_mode }}
ignored_metric_name_matches:
- "{{ ignored_metric_name_matches }}"
metric_name_matches:
- "{{ metric_name_matches }}"
name: "{{ name }}"
options:
data:
dynamic_tags:
exclude_not_queried_window_seconds: {{ exclude_not_queried_window_seconds }}
exclude_not_used_in_assets: {{ exclude_not_used_in_assets }}
queried_tags_window_seconds: {{ queried_tags_window_seconds }}
related_asset_tags: {{ related_asset_tags }}
manage_preexisting_metrics: {{ manage_preexisting_metrics }}
metric_match:
is_queried: {{ is_queried }}
not_queried: {{ not_queried }}
not_used_in_assets: {{ not_used_in_assets }}
queried_window_seconds: {{ queried_window_seconds }}
used_in_assets: {{ used_in_assets }}
override_previous_rules: {{ override_previous_rules }}
version: {{ version }}
tags:
- "{{ tags }}"
type: "{{ type }}"
REPLACE examples
- update_tag_indexing_rule
Partially update a tag indexing rule. Fields omitted from the request body are left unchanged.<br />Setting rule_order to a value already used by another rule returns 409; use the<br />reorder endpoint for atomic re-sequencing. Requires the Manage Tags for Metrics permission.
REPLACE datadog.metrics.tag_indexing_rules
SET
data = '{{ data }}'
WHERE
id = '{{ id }}' --required
AND data = '{{ data }}' --required
RETURNING
data;
DELETE examples
- delete_tag_indexing_rule
Soft-delete a tag indexing rule. Idempotent: returns 204 whether the rule existed or was already deleted.<br />Remaining rules in the org are automatically re-sequenced to keep rule_order dense and 1-based.<br />Requires the Manage Tags for Metrics permission.
DELETE FROM datadog.metrics.tag_indexing_rules
WHERE id = '{{ id }}' --required
;
Lifecycle Methods
EXEC variables use wire (API) names.
- reorder_tag_indexing_rules
Atomically re-sequence the tag indexing rules for an org to match the supplied list of rule UUIDs.<br />The server assigns rule_order 1, 2, … matching each rule UUID by position in the list.<br />The UUIDs of all active rules must be provided; omitting any active rule UUID returns a 400 error.<br />Requires the Manage Tags for Metrics permission.
EXEC datadog.metrics.tag_indexing_rules.reorder_tag_indexing_rules
@@json=
'{
"data": "{{ data }}"
}'
;