Skip to main content

tag_indexing_rules

Creates, updates, deletes, gets or lists a tag_indexing_rules resource.

Overview

Nametag_indexing_rules
TypeResource
Iddatadog.metrics.tag_indexing_rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe unique identifier (UUID) of the tag indexing rule. (example: 00000000-0000-0000-0000-000000000001)
attributesobjectAttributes of a tag indexing rule.
typestringThe 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:

NameAccessible byRequired ParamsOptional ParamsDescription
get_tag_indexing_ruleselectidGet a single tag indexing rule by its UUID.
list_tag_indexing_rules_for_metricselectmetric_nameList 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_rulesselectpage[limit], page[offset], searchList tag indexing rules for an org, sorted by rule_order, with offset/limit pagination.
create_tag_indexing_ruleinsertdataCreate 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_rulereplaceid, dataPartially 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_ruledeleteidSoft-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_rulesexecdataAtomically 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.

NameDatatypeDescription
idstringID of the tag indexing rule. (example: 00000000-0000-0000-0000-000000000001)
metric_namestringThe name of the metric. (example: dist.http.endpoint.request)
sitestringThe 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).

SELECT examples

Get a single tag indexing rule by its UUID.

SELECT
id,
attributes,
type
FROM datadog.metrics.tag_indexing_rules
WHERE id = '{{ id }}' -- required
;

INSERT examples

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
;

REPLACE examples

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

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.

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 }}"
}'
;