The Dynatrace Cost Allocation function lets you allocate Dynatrace DPS usage and costs to your cost centers and products that utilize Dynatrace functionality. You can designate cost centers or products for cost allocation and associate those with the hosts, services, or users that utilize Dynatrace resources. This provides a transparent and detailed account of each cost center’s Dynatrace expenditure, helping your organization optimize its budgets.
The Dynatrace Cost Allocation feature incorporates two fields for cost centers and products. You can use either or both fields. These fields reflect your company's cost allocation structure, enabling you to develop two distinct perspectives: one based on your cost centers (for example, departments) and another based on your products or services (for example, Applicationname or ApplicationID). Of course, you can customize the use of these fields to fit your company's organizational framework.
Cost Allocation is not available for “early access” DPS licensing agreements signed prior to April 2023.
Cost Allocation is exclusively available for Dynatrace SaaS environments with a Dynatrace Platform Subscription (DPS).
The table below outlines the supported capabilities and any known limitations.
For more details, see Monitoring consumption per capability.
* K8s pod-based cost allocation is not available in application-only container monitoring.
We're continuously extending Cost Allocation support to cover additional Dynatrace capabilities. For complete details regarding your licensing agreement, please contact your Dynatrace account manager.
This tutorial offers a step-by-step process for setting up your system to utilize Dynatrace Cost Allocation features. Upon completion, you'll have successfully prepared your Dynatrace SaaS environment for Cost Allocation and learned to adjust the settings as necessary.
In this tutorial, you’ll learn how to:
The allow list guarantees that Cost Allocation recognizes only those cost centers and products you have identified as valid. Any input in the Cost Allocation field that doesn't correspond with a predefined value is disregarded, with those costs not explicitly distributed. Usage associated with any other value is grouped under not allowlisted. Similarly, usage lacking a Cost Allocation designation is grouped under unallocated. The Cost Allocation allow list consists of two separate lists—one for the valid cost centers and one for the valid products.
To add or remove fields from the allow list, go to Account Management > Subscription > Cost management.
In Cost Management, you'll find the Cost Allocation allow list configurations.
Note that the allow list might take some time to update, and changes are not retroactive. Removing a value from the Allow List won't affect past Cost Allocation data that used that value. You'll still be able to see the usage and costs associated with the removed value in the historical reports.
The Cost center allow list can be configured via the Account Management API. For details, see Dynatrace Platform Subscription API documentation.
Via OneAgent configuration, the following DPS Capabilities can be set up for Cost Allocation in a Dynatrace SaaS environment.
* This configuration can be used whenever a OneAgent is deployed. It doesn’t matter if the OneAgent is deployed on physical hosts, K8s nodes, K8s pods, or cloud servers.
For general OneAgent information, see OneAgent documentation.
Due to the needed OneAgent restart, we recommend that you set the host tag as OneAgent command-line parameters.
To add or change host tags, run the following command. For details, see Define tags and metadata for hosts.
Linux examples:
./oneagentctl --set-host-tag=dt.cost.costcenter=RnD
./oneagentctl --set-host-property=dt.cost.costcenter=RnD
Windows examples:
.\oneagentctl.exe --set-host-tag=dt.cost.product=AX
.\oneagentctl.exe --set-host-property=dt.cost.product=AX
Verify that properties are set.
./oneagentctl --get-host-tags
or
./oneagentctl --get-host-properties
Restart OneAgent: For details, see Stop/restart OneAgent on Linux
Alternative procedure
Use the Deployment Status app within your environments.
In Dynatrace, go to Deployment Status.
In the OneAgents section:
If your host doesn’t show up, confirm that you deactivated Show new OneAgent deployments.
Add or modify dt.cost.costcenter
or dt.cost.product
.
Restart OneAgent. For details, see Stop/restart OneAgent on Linux.
Note that the host overview page doesn't show whether the OneAgent was restarted after editing a cost center field via the web UI. To avoid any potential misunderstandings, we strongly recommend using the command line option to set the host tag.
This is a OneAgent example script for configuring cost center and product Cost Allocation entries on a Linux or Windows host. It sets the Cost Allocation cost center to “engineering” and the Cost Allocation product to “shipping-center” via Dynatrace OneAgent.
# Below are commands for setting Cost Allocation tags on hosts.# Ensure that OneAgent version 1.291 or later is installed.# The listed commands must be executed with root rights.# The command parameters used below to set tags and properties can also be used during the OneAgent installation.# More details about using oneagentctl available at https://docs.dynatrace.com/docs/shortlink/oneagentctl# More details about setting tags and properties on hosts available at https://docs.dynatrace.com/docs/shortlink/tagging-hostautotag# LinuxCOSTCENTER=EngineeringPRODUCT=shipping-center/opt/dynatrace/oneagent/agent/tools/oneagentctl --set-host-tag=dt.cost.costcenter="${COSTCENTER}" --set-host-tag=dt.cost.product="${PRODUCT}" --restart-service# WindowsCOSTCENTER=EngineeringPRODUCT= shipping-center%PROGRAMFILES%\dynatrace\oneagent\agent\tools\oneagentctl.exe --set-host-tag=dt.cost.costcenter="${COSTCENTER}" --set-host-tag=dt.cost.product="${PRODUCT}" --restart-service
The dt.cost.costcenter
and dt.cost.product
values can be removed from the OneAgent configuration whenever necessary.
Note that the values for Cost Allocation fields of already recorded costs are not changed in this case.
The updated configuration will only be reflected in updated values after the rename is implemented. Modifications or removal of Cost Allocation fields take effect after a short period.
Run the following command to remove Cost Allocation host tags. For details, see Define tags and metadata for hosts.
Use oneagentctl to remove properties
Linux examples
./oneagentctl --remove-host-tag=dt.cost.costcenter=RnD
./oneagentctl --remove-host-property=dt.cost.costcenter=RnD
Windows examples
.\oneagentctl.exe --remove-host-tag=dt.cost.product=AX
.\oneagentctl.exe --remove-host-property=dt.cost.product=AX
Verify that the properties are removed:
./oneagentctl --get-host-tags or ./oneagentctl --get-host-properties
Restart OneAgent: For details, see Stop/Restart OneAgent on Linux
./oneagentctl --restart-service
This OneAgent example script removes cost center and product Cost Allocation entries on a Linux or Windows host. It deletes the previously set Cost Allocation cost center field with the value engineering and the Cost Allocation product field with the value shipping-center via Dynatrace OneAgent.
# Below are commands for setting Cost Allocation tags on hosts.# Ensure that OneAgent version 1.291 or later is installed.# The listed commands must be executed with root rights.# The command parameters used below to set tags and properties can also be used during the OneAgent installation.# More details about using the oneagentctl: https://docs.dynatrace.com/docs/shortlink/oneagentctl.# More details about setting tags and properties on hosts: https://docs.dynatrace.com/docs/shortlink/tagging-hostautotag.# LinuxCOSTCENTER=EngineeringPRODUCT=shipping-center/opt/dynatrace/oneagent/agent/tools/oneagentctl --remove-host-tag=dt.cost.costcenter="${COSTCENTER}" --remove-host-tag=dt.cost.product="${PRODUCT}" --restart-service# WindowsCOSTCENTER=EngineeringPRODUCT= shipping-center%PROGRAMFILES%\dynatrace\oneagent\agent\tools\oneagentctl.exe --remove-host-tag=dt.cost.costcenter="${COSTCENTER}" --remove-host-tag=dt.cost.product="${PRODUCT}" --restart-service
The values for dt.cost.costcenter
and dt.cost.product
can be renamed or deleted. But there is no propagation to already recorded costs. This means the original value will persist for these costs, and the new value only starts to appear from when the renaming took effect. This is because past tracked consumption can't be changed. If the need arises to reassign past usage, this must done outside of the Dynatrace web UI based on the existing data export feature for Cost Allocation within the Account Management API.
See Extract Cost Allocation data via Account Management web UI for information on extracting Cost Allocation data.
Changing or deleting values takes a couple of minutes before going into effect. Please make sure the new values are also changed on the allow list.
For DPS consumption details, see built-in classic metrics. All DPS-related metrics have “DPS” in their name.
See Real User Monitoring classic metric documentation.
Until Dynatrace Cost Allocation is available, DQL query usage details can facilitate a workaround. For each DQL query, Dynatrace records the executing user and the calling application.
Relevant DQL queries can be found within Account Management > Subscription Overview.
You’ve set everything but still can’t find your Cost Allocation data? Please follow this checklist, which guides you through a validation process.
In Account Management, select Subscription > Cost management and switch to the Cost allocation tab.
In another window, go to Infrastructure & Operations on your environment.
Check the tags on the configured host.
Now, side by side, compare the Cost Allocation tags on the host with the Cost Allocation allow list
Did you restart the OneAgent?
As a best practice for cost center fields, we recommend using the organizational level to which the costs belong. If the organizational unit also has a unique ID, we recommend using both the text-based name and the ID separated by ,
or /
as they can be split into separate columns after the export.
Example: I need to report monthly on what certain business units have consumed in the Dynatrace platform.
Host 1: dt.cost.costcenter = “Business Unit 1 / BU-ID”
Host 2: dt.cost.costcenter = “Business Unit 1 / BU-ID”
Host 3: dt.cost.costcenter = “Business Unit 2 / BU-ID”
As a best practice for product fields, we recommend using the application or product group to which the costs belong. If the Application also has a unique ID, we recommend using both the text-based name and the ID separated by ,
or /
as they can be split into separate columns after the export.
Example: I need to report monthly what certain applications have consumed in Dynatrace.
Host 1: dt.cost.product = “Applicationname / AppID”
Host 2: dt.cost.product = “Applicationname / AppID”
Host 3: dt.cost.product = “Applicationname / AppID”
For a shared service (for example, a large host with Full-Stack Monitoring supporting multiple products), define a Cost Allocation value representing the shared group and allocate its costs outside Dynatrace.
Example: The Host “Omega” is utilized for both the “Webpage” and “Mobile App” products. It should be divided such that 40% is attributed to “Webpage” and 60% to “Mobile App”. To achieve this, host Omega is set up with dt.cost.product=”Webpage_MobileApp
.
Cost Allocation data and expenses are retrieved from Account Management, imported into an Excel or Power BI Board, and configured to allocate the costs between “Webpage” and “Mobile App” in the 40% to 60% ratio.
In this tutorial, you'll learn how DPS licensing consumption is distributed among your organization’s various products or cost centers. You’ll discover how to retrieve reported Cost Allocation data—whether by exporting the data to an external reporting tool or utilizing our comprehensive set of Grail reporting capabilities.
By the end of this tutorial, you'll be proficient in:
This tutorial will help you make informed decisions about your budgeting, costs, and resource allocation strategies. Let's get started!
Your licensing consumption and related costs are calculated daily based on the details of your licensing agreement and rate card. Therefore, you won’t see costs for certain capabilities utilized within the past 24 hours. Nonetheless, your usage is reported once every 15 minutes.
A CSV file containing all Cost Allocation data of the current subscription can be exported from the Cost Management - Cost Allocation page.
All Cost Allocation data can be retrieved via the Account Management API.
First, you need to generate an Account Management API token. For complete instructions, go to Authentication for the Account Management API. To retrieve Cost Allocation details, you’ll need the permission View usage and consumption: account-uac-read.
The API endpoint provides cost and usage data based on Cost Allocation fields for the specified period. Costs and usage are calculated once every 24 hours. Depending on the selected time period, only usage data might be available.
Further details can be found here in Account Management API documentation.
#Retrieve cost and usage details by cost center or product for a specific environmentGET /v1/subscriptions/{subscription-uuid}/cost-allocation?field={field}\&environment-id={environment-id}
Sample response
{"records": [{ "date": "2024-04-01", "capability": "FULLSTACK_MONITORING","key": "department-A", "costs": 10, "usage": 2000 },{ "date": "2024-04-01", "capability": "FULLSTACK_MONITORING","key": "department-B", "costs": 40, "usage": 8000 },{ "date": "2024-04-01", "capability": "LOGS", "key": "department-A", "costs": 70, "usage": 700 },{ "date": "2024-04-01", "capability": "LOGS", "key": "department-B", "costs": 20, "usage": 200 },{ "date": "2024-04-01", "capability": "FULLSTACK_MONITORING", "key": "department-E", "costs": 10, "usage": 2000 },{ "date": "2024-04-01", "capability": "FULLSTACK_MONITORING", "key": "department-F", "costs": 50, "usage": 10000 },{ "date": "2024-04-01", "capability": "FULLSTACK_MONITORING", "key": null, "costs": 60, "usage": 12000 },{ "date": "2024-04-01", "capability": "LOGS", "key": null, "costs": 10, "usage": 100 },{ "date": "2024-04-02", "capability": "FULLSTACK_MONITORING", "key": "department-A", "costs": 10, "usage": 2000 },{ "date": "2024-04-02", "capability": "FULLSTACK_MONITORING", "key": "department-B", "costs": 40, "usage": 8000 },{ "date": "2024-04-02", "capability": "FULLSTACK_MONITORING", "key": "department-C", "costs": 70, "usage": 14000 },{ "date": "2024-04-02", "capability": "LOGS", "key": null, "costs": 500, "usage": 5000 }// more daily records],"nextPageKey": "...","environmentId": "tenant-A","field": "COSTCENTER"}
A dedicated Cost Allocation web UI for Account Management is not yet available. Please export Cost Allocation data to an external reporting tool or analyze license consumption at the environment level using environment-specific dashboards.
The related Cost Allocation data is stored in Grail as billing usage events within each environment. Billing usage events can be analyzed using Dynatrace platform tools like Dashboards and Notebooks. Below, you'll find several Dynatrace Query Language (DQL) examples. For additional examples, refer to our DPS Cost Allocation usage & costs Dashboard. The DPS Cost Allocation usage & costs Dashboard can be found on the Dynatrace Playground.
From there, you can download the dashboard and upload it in any environment of your choosing.
For details on DQL syntax, see the DQL Documentation.
Remember that licensing consumption calculations are performed once every 24 hours, so you might not see the costs for certain capabilities that were used recently. Nonetheless, your usage is reported every 15 minutes.
fetch dt.system.events| filter event.kind == "BILLING_USAGE_EVENT"
fetch dt.system.events| filter event.kind == "BILLING_USAGE_EVENT"| fieldsKeep event.type, dt.entitiy.host, dt.cost.costcenter, dt.cost.product
fetch dt.system.events| filter event.kind == "BILLING_USAGE_EVENT"| summarize count = count(), by:{event.type,dt.cost.costcenter}
The Cost Allocation Demo Dashboard illustrates how these DQL queries can be used.
Be aware that the costs shown in the Demo Dashboard are based on manual cost assignments in the DQL query and are not automatically cross-checked with your rate card.