Configure Cost Allocation for Kubernetes

  • Latest Dynatrace
  • How-to guide
  • 5-min read
  • Published Mar 31, 2025

This section describes how to set up Allocate your DPS costs in Kubernetes-based deployments.

Cost Allocation is supported for different Kubernetes deployment models.

Configuration via metadata enrichment

Use Kubernetes Metadata Enrichment to configure

  • Cost Allocation on a Kubernetes Platform Monitoring + Full-Stack Observability deployment.
  • Telemetry enrichment for log and trace ingest on any Kubernetes-based deployment.

When configuring metadata enrichment, set the Target to dt.cost.costcenter or dt.cost.product as is appropriate.

For more information, see Kubernetes Metadata Enrichment.

Kubernetes Metadata Enrichment settings do not apply to Kubernetes clusters that have a cluster-specific rule set.

To configure the data enrichment on the Kubernetes cluster level, go to Kubernetes > [Kubernetes Cluster] > Settings > Enrichment rules.

Configuration via DynaKube custom resources

Use Dynakube custom resources to configure

  • Cost Allocation on a Kubernetes Platform Monitoring + Full-Stack Observability deployment.
  • Cost Allocation on a Kubernetes Platform Monitoring + Application observability deployment.

Pass the configuration via the args parameter in the DynaKube parameters for Dynatrace Operator. The code block provides a snippet from the configuration file to show the usage of --set-host-tag=dt.cost.costcenter=<cost-center> and --set-host-tag=dt.cost.product=<product>.

spec:
apiUrl: https://<environment-id>.live.dynatrace.com/api
oneAgent:
cloudNativeFullStack:
args:
- --set-host-tag=dt.cost.costcenter=it_services
- --set-host-tag=dt.cost.product=fin_app

Configuration via dedicated pod annotations

Use dedicated pod annotations to configure Cost Allocation on a Kubernetes Platform Monitoring + Application observability deployment.

You can enrich your data using dedicated pod annotations, for example by creating the following annotations at the pod level:

metadata:
annotations:
metadata.dynatrace.com/dt.cost.costcenter: it_services
metadata.dynatrace.com/dt.cost.product: fin_app

To add or modify global enrichment settings:

  1. Add the relevant annotation(s) to the configuration file, following the example in the code block above.
  2. Wait for up to 45 minutes and restart your pod(s).

To remove global enrichment settings:

  1. Delete the relevant annotation(s) from the configuration file.
  2. Wait for up to 45 minutes and restart your pod(s).
Related tags
Dynatrace Platform