Skip to main content

tags

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

Overview

Nametags
TypeResource
Iddatadog.cloud_costs.tags

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe tag identifier, equal to its key:value representation. (example: providername:aws)
attributesobjectAttributes of a Cloud Cost Management tag.
typestringType of the Cloud Cost Management tag resource. (cost_tag) (default: cost_tag, example: cost_tag)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_cost_tagsselectfilter[metric], filter[match], filter[tags], filter[tag_keys], page[size]List Cloud Cost Management tags for a given metric.

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
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[match]stringA substring used to filter the returned tags by name.
filter[metric]stringThe Cloud Cost Management metric to scope the tags to. When omitted, returns tags across all metrics.
filter[tag_keys]arrayRestrict the returned tags to those whose key matches one of the given tag keys.
filter[tags]arrayFilter to return only tags that appear with the given key:value tag values. For example, filter[tags]=providername:aws returns tags found on the same cost data, such as aws_instance_type:t3.micro and aws_instance_type:m5.large.
page[size]integer (int32)Controls the size of the internal tag search scope. This does not restrict the number of tags returned in the response. Defaults to 50, maximum 10000.

SELECT examples

List Cloud Cost Management tags for a given metric.

SELECT
id,
attributes,
type
FROM datadog.cloud_costs.tags
WHERE filter[metric] = '{{ filter[metric] }}'
AND filter[match] = '{{ filter[match] }}'
AND filter[tags] = '{{ filter[tags] }}'
AND filter[tag_keys] = '{{ filter[tag_keys] }}'
AND page[size] = '{{ page[size] }}'
;