Skip to main content

tag_configurations

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

Overview

Nametag_configurations
TypeResource
Iddatadog.metrics.tag_configurations

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe metric name for this resource. (example: test.metric.latency)
attributesobjectObject containing the definition of a metric tag configuration attributes.
relationshipsobjectRelationships for a metric.
typestringThe metric tag configuration resource type. (manage_tags) (default: manage_tags, example: manage_tags)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_tag_configuration_by_nameselectmetric_nameReturns the tag configuration for the given metric name.<br /><br />A metric may exist and submit data without having a tag configuration. If no tag configuration exists<br />for the metric, this endpoint returns 404 Not Found. This response does not indicate that the metric<br />itself is missing.
list_tag_configurationsselectfilter[configured], filter[is_configurable], filter[tags_configured], filter[metric_type], filter[include_percentiles], filter[queried], filter[queried][window][seconds], filter[tags], filter[related_assets], include, sort, window[seconds], page[size], page[cursor]Get a list of actively reporting metrics for your organization. Pagination is optional using the page&#91;cursor&#93; and page&#91;size&#93; query parameters.<br /><br />Query parameters use bracket notation (for example, filter&#91;tags&#93;, filter&#91;queried&#93;&#91;window&#93;&#91;seconds&#93;). Pass them as standard URL query strings, URL-encoding the brackets if your client does not handle them. For example: GET /api/v2/metrics?filter&#91;tags&#93;=env:prod&window[seconds&#93;=86400&page[size&#93;=500.
create_tag_configurationinsertmetric_name, dataCreate and define a list of queryable tag keys for an existing count/gauge/rate/distribution metric.<br />Optionally, include percentile aggregations on any distribution metric. By setting exclude_tags_mode<br />to true, the behavior is changed from an allow-list to a deny-list, and tags in the defined list are<br />not queryable. Can only be used with application keys of users with the Manage Tags for Metrics<br />permission.
update_tag_configurationupdatemetric_name, dataUpdate the tag configuration of a metric or percentile aggregations of a distribution metric or custom aggregations<br />of a count, rate, or gauge metric. By setting exclude_tags_mode to true the behavior is changed<br />from an allow-list to a deny-list, and tags in the defined list will not be queryable.<br />Can only be used with application keys from users with the Manage Tags for Metrics permission. This endpoint requires<br />a tag configuration to be created first.
delete_tag_configurationdeletemetric_nameDeletes a metric's tag configuration. Can only be used with application<br />keys from users with the Manage Tags for Metrics permission.<br />Note: This operation is irreversible.

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
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.
filter[configured]booleanOnly return custom metrics that have been configured (true) or not configured (false) with Metrics Without Limits. (example: true)
filter[include_percentiles]booleanOnly return distribution metrics that have percentile aggregations enabled (true) or disabled (false). (example: true)
filter[is_configurable]booleanOnly return metrics that are eligible (true) or ineligible (false) for configuration with Metrics Without Limits. (example: true)
filter[metric_type]stringOnly return metrics of the given metric type.
filter[queried]booleanOnly return metrics that have been queried (true) or not queried (false) in the look back window. Set the window with filter&#91;queried&#93;&#91;window&#93;&#91;seconds&#93;; if omitted, a default window is used. (example: true)
filter[queried][window][seconds]integer (int64)This parameter has no effect unless filter&#91;queried&#93; is also set. Only return metrics that have been queried or not queried in the specified window. The default value is 2,592,000 seconds (30 days), the maximum value is 15,552,000 seconds (180 days), and the minimum value is 1 second. For example: filter&#91;queried&#93;=true&filter[queried&#93;&#91;window&#93;&#91;seconds&#93;=604800. (example: 15552000)
filter[related_assets]booleanOnly return metrics that are used in at least one dashboard, monitor, notebook, or SLO. (example: true)
filter[tags]stringOnly return metrics that were submitted with tags matching this expression. You can use AND, OR, IN, and wildcards. For example: filter&#91;tags&#93;=env IN (staging,test) AND service:web*. (example: env IN (staging,test) AND service:web*)
filter[tags_configured]stringOnly return metrics that have the given tag key(s) in their Metrics Without Limits configuration (included or excluded). (example: app,env)
includestringInclude related resources in the response. Set to metric_volumes to include indexed and ingested volume counts for each metric. (example: metric_volumes)
page[cursor]stringCursor for pagination. Use page&#91;size&#93; to opt-in to pagination and get the first page; for subsequent pages, use the value from meta.pagination.next_cursor in the response. Pagination is complete when next_cursor is null.
page[size]integer (int32)Maximum number of results per page. Send page&#91;size&#93; on the first request to opt in to pagination. On each subsequent request, send page&#91;cursor&#93; set to the value of meta.pagination.next_cursor from the previous response. The default value is 10000, the maximum value is 10000, and the minimum value is 1.
sortstringSort results by metric volume. Prefix a key with - for descending order. Supported keys: metric_volumes.indexed_volume, metric_volumes.ingested_volume, metric_volumes.indexed_volume_delta, metric_volumes.ingested_volume_delta. Requires a paginated request (page&#91;size&#93; or page&#91;cursor&#93;). (example: -metric_volumes.indexed_volume)
window[seconds]integer (int64)Only return metrics that have been actively reporting in the specified window. The default value is 3600 seconds (1 hour), the maximum value is 2,592,000 seconds (30 days), and the minimum value is 1 second. (example: 3600)

SELECT examples

Returns the tag configuration for the given metric name.<br /><br />A metric may exist and submit data without having a tag configuration. If no tag configuration exists<br />for the metric, this endpoint returns 404 Not Found. This response does not indicate that the metric<br />itself is missing.

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

INSERT examples

Create and define a list of queryable tag keys for an existing count/gauge/rate/distribution metric.<br />Optionally, include percentile aggregations on any distribution metric. By setting exclude_tags_mode<br />to true, the behavior is changed from an allow-list to a deny-list, and tags in the defined list are<br />not queryable. Can only be used with application keys of users with the Manage Tags for Metrics<br />permission.

INSERT INTO datadog.metrics.tag_configurations (
data,
metric_name
)
SELECT
'{{ data }}' /* required */,
'{{ metric_name }}'
RETURNING
data
;

UPDATE examples

Update the tag configuration of a metric or percentile aggregations of a distribution metric or custom aggregations<br />of a count, rate, or gauge metric. By setting exclude_tags_mode to true the behavior is changed<br />from an allow-list to a deny-list, and tags in the defined list will not be queryable.<br />Can only be used with application keys from users with the Manage Tags for Metrics permission. This endpoint requires<br />a tag configuration to be created first.

UPDATE datadog.metrics.tag_configurations
SET
data = '{{ data }}'
WHERE
metric_name = '{{ metric_name }}' --required
AND data = '{{ data }}' --required
RETURNING
data;

DELETE examples

Deletes a metric's tag configuration. Can only be used with application<br />keys from users with the Manage Tags for Metrics permission.<br />Note: This operation is irreversible.

DELETE FROM datadog.metrics.tag_configurations
WHERE metric_name = '{{ metric_name }}' --required
;