You can use Cost Allocation to allocate your Dynatrace Platform Subscription (DPS) usage to the cost centers and products that you define.
Allocating costs provides a transparent and detailed account of the Dynatrace expenditures that originate from each cost center or product, which in turn helps your organization optimize its budgets. Cost Allocation works with metric data regardless of your ingestion method.
On this page, you'll learn how to set up Cost Allocation for metrics data.
For ingested metrics, you can allocate costs related to ingest consumption. Dynatrace natively supports Cost Allocation for Metrics - Ingest, as described on this page.
We recommend setting up Cost Allocation along organizational lines and deployment scopes.
Suitable concepts include resource attributes that are already present on your metric data, such as dt.host_group.id, k8s.namespace.name, or host.name.
These attributes are typically available on all metrics, regardless of ingest method.
To add Cost Allocation information to your metrics, enrich your records with the dt.cost.costcenter and dt.cost.product Grail attributes.
Cost Allocation works regardless of how the metrics were ingested, whether via OneAgent, the Metrics ingest API, or OpenTelemetry.
Depending on how you ingest your metrics, there are different ways to allocate your costs. Our recommendations are:
With ingest enrichment, you can create rules to automatically enrich all ingested metric signals with dt.cost.costcenter and dt.cost.product.
The data is stored in Grail:
Dashboards,
Notebooks, Account Management, and the Dynatrace API.For more information about enriching on ingest, see Configure ingest enrichment rules.
You can define Cost Allocation at the source via OneAgent, Kubernetes labels or annotations, or OpenTelemetry.
This lets you use your existing labels and tags, so that dt.cost.costcenter and dt.cost.product are already present when your data arrives.
If you only need to allocate costs at the deployment level of granularity, you can use OpenPipeline to
Do this in the Cost allocation and Product allocation stages in OpenPipeline.
Identify the primary Grail field that you want to base your allocation on, such as k8s.namespace.name or host.name.
Go to OpenPipeline > Metrics.
Go to the Pipelines tab, select an existing pipeline or create a new one, and go to the Cost allocation stage (to set dt.cost.costcenter) or the Product allocation stage (to set dt.cost.product).
Add a DPS Cost Allocation - Cost Center or DPS Cost Allocation - Product processor. Define a matching condition, such as:
matchesValue(metric.key, "http.server.request.duration_bucket") and matchesValue(http.route, "/basket")
Set the value either as a static string, such as TeamA, or copied from a field on the record.
For the full list of parameters and processor examples, see Cost allocation via OpenPipeline.
When new metric data arrives, the matching records get a dt.cost.costcenter or dt.cost.product attribute. To confirm this, open
Notebooks and run a DQL query such as:
timeseries median(http.server.request.duration_bucket), by:{http.route, dt.cost.costcenter}
If you have a more sophisticated strategy for cost center tags, it might not be enough to map a single field directly to dt.cost.costcenter or dt.cost.product.
In this case, we recommend that you use a DQL processor in OpenPipeline to derive cost centers or products from a combination of fields, and then set dt.cost.costcenter or dt.cost.product from the resulting field with the Cost allocation stage. For examples, see OpenPipeline processing examples.
Before you change the values of dt.cost.costcenter or dt.cost.product, make sure they're defined in the Cost Allocation allow lists.