Overview

Tags help you investigate and understand your cloud and SaaS costs across any dimensions. Tags consist of tag keys and values. For example, in aws_product:ec2, the tag key is aws_product, and the value is ec2.

Cloud Cost Management automatically enriches your cost data with tags from multiple sources, to help you achieve better cost allocation and get deeper insight into who owns infrastructure costs in your ever-changing cloud environments. Using tags, you can allocate shared costs fairly, create accurate reports, and track costs by team, service, or environment.

Where tags come from

Across all cloud and SaaS providers, Datadog collects tags from the following sources (including enriching cost data with data from other Datadog products) and adds them to your cost data:

SourceWhat tags are collectedDescription
All ProvidersBill columnsSuch as AWS Cost and Usage Report (CUR) columns, Google Billing Export columns, and so on
Datadog EnrichmentHost AgentTags added to host metadata by the Datadog Agent running on the host
Datadog EnrichmentSoftware CatalogTags associated with this service in the APM Service Catalog
Datadog EnrichmentIntegration TilesTags added to the Datadog integration tile for a specific cloud account. Integration tile tags apply to all costs in that account. Requires enabling the provider integration for each account
Datadog EnrichmentData ObservabilityTags from Datadog Data Observability, powering BigQuery cost allocation. Requires enabling BigQuery monitoring
Datadog EnrichmentCloud Network MonitoringSource and destination dimensions from Datadog Cloud Network Monitoring. Requires enabling Cloud Network Monitoring in the Datadog Agent. See data transfer cost allocation for more details
Kubernetes EnrichmentKubernetes NodeUser-defined tags found on Kubernetes nodes monitored with Datadog
Kubernetes EnrichmentKubernetes PodUser-defined tags found on Kubernetes pods monitored with Datadog
Kubernetes EnrichmentKubernetes Persistent VolumeUser-defined tags found on Persistent Volumes in Kubernetes clusters monitored with Datadog
Kubernetes EnrichmentKubernetes Persistent Volume ClaimUser-defined tags found on Persistent Volume Claims in Kubernetes clusters monitored with Datadog
Cloud Cost ManagementCloud Cost AliasesTags derived from provider cost data to simplify the cost data model, such as aws_product (an alias of lineItem/ProductCode). Additional tags that exist on both cost data and integration metrics are added, allowing cost data and usage data to be combined in Custom Allocation Rules, dashboards, and notebooks
Cloud Cost ManagementCloud Cost AllocationTags created during cost allocation that specify the split of shared resources, such as allocated_spend_type
Cloud Cost ManagementFOCUSProvider-agnostic tags compliant with FOCUS, an open specification that normalizes cost and usage datasets across cloud vendors
Tag PipelinesRules defined by userTags created by applying your Tag Pipelines to cost data
Custom Allocation RulesRules defined by userTags created by applying your Custom Allocation Rules to cost data (does not apply to SaaS costs)

Datadog also adds provider-specific tags:

ProviderWhat tags are collectedDescription
AWSCost Allocation TagsAny tag defined by the user in AWS Cost Allocation tags that show up in the AWS CUR
AWSAWS Resource Groups Tagging APIUser-defined tags on a cloud resource in AWS, pulled by Cloud Cost Management using the Groups Tagging API
AWSAWS Organizational UnitsUser-defined tags on AWS organizational units using AWS Organizations
AWSAWS Organizations - AccountsUser-defined tags on an AWS account using AWS Organizations
Amazon ECSAmazon ECS TaskUser-defined tags on an ECS task definition
Amazon ECSAmazon ECS ContainerUser-defined tags on a container running in an ECS task
AzureAzure Cost Export - User Resource TagsUser-defined tags on a cloud resource in Azure, found in the Tags column in the Azure cost export. Does not include Resource Group tags
AzureAzure Cost Export - System Resource TagsAzure-defined tags on a cloud resource, found in the AdditionalInfo column in the Azure cost export
Google CloudGoogle Billing Export - Project LabelsUser-defined labels on a project in Google Cloud, found in the project.labels column in the billing export
Google CloudGoogle Billing Export - System Resource LabelsSystem-generated labels on a resource in Google Cloud, found in the system_labels column in the billing export
Google CloudGoogle Billing Export - User Resource LabelsUser-defined labels on a cloud resource in Google Cloud, found in the labels column in the billing export
Google CloudGoogle Billing Export - User Resource TagsUser-defined tags on a cloud resource in Google Cloud, found in the tags column in the billing export. The goog-originating-sku-description tag is added leveraging Google’s SKU APIs, to provide more granular SKU details for commitment line items.
Google CloudGKE PodUser-defined labels found on pods running in Google Kubernetes Engine
Oracle CloudOCI Cost Export - User Resource TagsUser-defined tags on a cloud resource in Oracle Cloud Infrastructure, from the Tags column in the OCI FOCUS cost export
DatadogDatadog Usage AttributionUser-defined tags for Usage Attribution in Datadog Plan and Usage
Custom CostsCost File TagsUser-defined tags for every provider, found on cost files uploaded to Cloud Cost Management

How tags are normalized

Tag keys and values may look slightly different in Cloud Cost Management compared to the providers or other parts of Datadog because of tag normalization.

Cloud Cost Management normalizes tag keys in a similar way to Datadog Metrics:

  • Drop leading characters that are not letters
  • Lowercase all characters
  • Replace special characters and spaces with single underscores _
  • Remove any trailing underscores
  • Reduce contiguous underscores to a single underscore
  • Tag keys up to 5000 characters are supported, and any characters before the first letter are dropped so that tag keys start with letters (different from Datadog Metrics)

Cloud Cost Management normalizes tag values as well, while maintaining human readable tag values for cost reporting. For example, aws_instance_family:Machine Learning ASIC Instances remains readable rather than being converted to something like machine_learning_asic_instances. The normalization follows this logic:

  • Convert any consecutive whitespaces to a single space
  • Keep all letters, marks, numbers, punctuation, and symbols
  • Replace any other characters with an underscore _
  • Tag values up to 5000 characters are supported

How tags are prioritized

A cost data row can have multiple values for the same tag key when tag values from two or more sources are combined and one is not prioritized over the other.

To resolve conflicts and mitigate this, Cloud Cost Management replaces existing tags instead of adding duplicates using the most specific source for each tag key. For example, a Kubernetes Pod tag team:shopping would take precedence and replace a Kubernetes node tag team:compute.

Sources higher in this list replace tag values from sources lower in this list, if there are conflicts:

  • Custom Allocation Rules
  • FOCUS
  • Service Catalog
  • Amazon ECS Container
  • Amazon ECS Task
  • Kubernetes Pod
  • Kubernetes Persistent Volume
  • Kubernetes Node
  • Host Agent

Other tag sources (such as AWS Organization tags, integration tile tags, and similar sources) can be overridden by these sources. Bill columns and FOCUS columns are reserved and cannot be overridden by any source. Tag Pipelines add new tags but do not override existing tags.

Improving tagging

  1. Understand what tags exist - Use the Tag Explorer to discover which tags are already available in your cost data.
  2. Identify gaps in cost allocation - In the Explorer, group by any tag to see the cost allocated to that tag, or unallocated (which is displayed as N/A). Make sure to have “Container Allocated” enabled so that you are looking at a cost allocation that includes tags on pods.
  3. Split up shared costs - Use Custom Allocation Rules to split and assign shared costs back to teams, services, and more. You can use observability data to split costs accurately based on infrastructure usage.
  4. Address missing or incorrect tags - Use Tag Pipelines to alias tags, or create a new tag, for incorrect tagging. For example, if your organization wants to use the standard application tag key, but teams use variations (like app, webapp, or apps), you can consolidate those tags to become application for more accurate cost reporting.
  5. Add new tags - Use Tag Pipelines to automatically create new inferred tags that align with specific business logic, such as a business-unit tag based on team structure.
Tag Explorer interface showing available AWS tags and their usage

Further reading