- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
Datadog provides log usage information through the Log Estimated Usage dashboard, the Plan and Usage section in the app, and the available logs usage metrics. However, there might be situations where you want visibility into more granular cost attribution data, such as for specific teams.
This guide walks you through the steps on how to create custom metrics and a dashboard to see your log cost attribution for different teams. You can also use this process for other attributes, such as departments, projects, products, regions, and so on.
Create a new log pipeline that filters to logs for which you want to attribute costs. For this example, filter to the subset of logs that you want to breakdown by team.
Cost attribution by team
.Leave the new pipeline at the end of the list of pipelines. This lets the logs go through the other pipelines so that those tags and attributes are created first.
Add all processors you create for this cost attribution example to the new pipeline.
team
tagDatadog recommends that you use one of these tagging methods to add the team
tag to logs before ingestion.
However, if you need to configure the tag during ingestion, follow these steps to create and add a team
tag.
You can use this process to create the attributes you want for breaking down your log usage (for example, by departments, products, regions, and so forth).
team
attributeUse a Category Processor to create a new team
attribute for your logs.
team
in the Set target category attribute field. This creates a team
attribute.team:service_a
to log events that match service:a
and env:prod
:
a. Enter service:a
and env:prod
in the All events that match field.service_a
in the Appear under the value name field.team
attribute to a tagteam
.team
.Create custom tags so you can organize custom log usage metrics into categories that are relevant to your use case. For this example, create the following tags:
retention_period
for indicating the number of days for which logs are retained in Datadog indexes.online_archives
for indicating whether logs have been routed to Online Archives.sds
for indicating whether logs have been scanned by the Sensitive Data Scanner.retention_period
tagretention_period
tag even if your indexes all have the same retention period. This makes sure that if you start using multiple retention periods, all logs are tagged with its retention period.retention_period
is the number of days your logs are retained in Datadog indexes. Since indexing billing costs are incurred based on the number of days that the logs are retained, use the retention_period
tag to associate each log with its retention period to see cost attribution.
Datadog recommends using the following method to configure the retention_period
tag:
index_name
attribute.retention_period
attribute.retention_period
attribute to a tag.index_name
attributeUse a Category Processor to create a new index_name
attribute for identifying the index to which the logs are routed.
index_name
attribute.retention-7
for all logs tagged with env:staging
:Then, in the Populate category section:env:staging
in the All events that match field.retention-7
in the Appear under the value name field.retention_period
attributeUse a Category Processor to create a new retention_period
attribute to associate the index with its retention period.
retention_period
in the Set target category attribute field. This creates a retention_period
attribute.retention-7
, then in the Populate category section:@index_name:(retention-7)
in the All events that match field.7
in the Appear under the value name field.retention_period
attribute to a tagretention_period
.retention_period
.online_archives
tagonline_archives
tag even if none of your indexes have online archives enabled. This ensures that if you start using Online Archives, the relevant logs are tagged with online_archives
.The online_archives
tag indicates whether or not your logs have been routed to Online Archives. Since Online Archives are charged differently than standard indexing, use the online_archives
tag to determine which logs have been routed to Online Archives and see cost attribution.
Datadog recommends using the following method to configure the online_archive
tag:
online_archives
attributeUse a Category Processor to create a new online_archives
attribute to indicate whether or not the associated index has Online Archives enabled.
online_archives
attribute.true
is assigned to all indexes with Online Archives enabled. For example, if logs in the index named retention-30
go into Online Archives:@index_name:(retention-30)
in the All events that match field.true
in the Appear under the value name field.false
is assigned to all other indexes.*
in the All events that match field.false
in the Appear under the value name field.online_archives
attribute to a tagonline_archives
.online_archives
.Datadog highly recommends automating this process by using the Datadog API endpoints to automatically retrieve and update the configuration.
sds
tagsds
tag even if you are not using the Sensitive Data Scanner. This makes sure that if you start using Sensitive Data Scanner, all the relevant logs are tagged with sds
.The sds
tag indicates whether or not your logs have been scanned by the Sensitive Data Scanner. Use the sds
tag to estimate the costs associated with the specific usage of Sensitive Data Scanner.
For the Sensitive Data Scanner, billed usage is based on the volume of logs scanned, so it matches a scanning group, not a scanning rule. Therefore, you need to create a proxy scanning rule in each scanning group with a regex to match all logs. This ensures that all scanned logs are tagged.
.
in the Define Regex to match field to match all logs.sds:true
in the Add tags field.Datadog provides a set of logs usage metrics so that you can see estimated usage. However, since these metrics cannot be modified, you can generate custom logs metrics for your specific log usage cases instead.
Since usage is measured either in gigabytes (GB) or in millions of events depending on the product, you need to generate two different metrics:
When setting up custom metrics, the tags in the group by
field are the dimensions of your metric. Use these fields to filter and aggregate the metrics once they are generated. Make sure to include the following tags in the group by
field:
datadog_index
, if the log is routed, the tag contains the name of the index to which the log is routed.datadog_is_excluded
indicates whether the log is rejected by an exclusion filter in the routed index.team
, retention_period
, online_archives
, and sds
).See Generate a log-based metric for instructions on generating the metrics.
There are several ways to use the generated custom log metrics in Datadog. The metrics can be displayed in dashboards, alerted on, used in Notebooks, queried in the Metrics Explorer, and more.
Datadog recommends that you create a dashboard with a table widget for each of the following products to track their usage:
To create a new dashboard:
Datadog recommends that you configure the table widget for Log Ingestion in the following way:
team
tag to show the usage in bytes by team. You can also add other tags for your different cost buckets, for example, the host
tag to see usage by host.Usage in gigabytes
* Unit cost for Log Ingestion
.Datadog recommends that you configure the table widget for the Sensitive Data Scanner in the following way:
sds:true
to filter only for logs that have been scanned by the Sensitive Data Scanner.team
tag to show the usage in bytes by team. You can also add other tags for your different cost buckets.Usage in gigabytes
* Unit cost for the Sensitive Data Scanner
.Since indexing is charged based on the number of days the logs are retained, create one widget for each retention period.
Datadog recommends that you configure the table widget for Log Indexing in the following way:
datadog_index:*
to filter to only logs that have been routed to indexes.datadog_is_excluded:false
to filter to only logs that have not matched any exclusion filter.retention_period:7
to filter to only logs that are retained for 7 days. You don’t need to add this tag if you have the same retention period for all your indexes and therefore did not set up this tag earlier. If you have additional retention_period
tags, create a separate widget for each one.team
tag to show the usage in events, by team. You can also add other tags for your different cost buckets.Usage in millions of events
* Unit cost for 7 days of retention
. If your contractual price per million of events changes, you need to update the formula manually.Create widgets for each retention_period
tag.
When Online Archives is enabled for an index, logs are duplicated and go into both:
Therefore, exclusion filters do not apply to logs that go into the Online Archives.
Based on that information, Datadog recommends that you configure the table widget for Online Archives in the following way:
datadog_index:*
to filter to only logs that have been routed to indexes.online_archives:true
to filter to only logs that have also been routed to Online Archives.team
tag to show the usage in events by team. You can also add tags for different cost buckets.Usage in millions of events
* Unit cost for Online Archives
.You can aggregate all products into a single widget to get visibility into the total usage and costs. Datadog recommends that you configure the table widget in the following way: