Overview

Sensitive Data Scanner reports the volume of data it scans in Logs, APM, RUM, and Events with the datadog.estimated_usage.sds.scanned_bytes estimated usage metric. Use this guide to track scanned volume in a graph or alert on it, and to read the breakdown by product and service correctly. This guide is for teams that manage Sensitive Data Scanner adoption or cost and want to see which products and services drive scanned volume.

The metric includes the following tags:

product
The product the scanned data comes from: Logs, APM, RUM, or Events.
service
The service the scanned data comes from. Data without a service tag is grouped under service:unknown. Some Events and Logs data appears under service:undefined instead. Treat both values as data without a service when you read the breakdown.
scanning_group_id
The scanning group that scanned the data. The scanning_group_id:global value prevents the same event from being counted multiple times when different scanning groups scan it. Exclude it from your queries. It does not impact billing.

Prerequisites

Before you start, verify you have:

Graph scanned volume by product and service

  1. Navigate to the Metrics Explorer, or add a timeseries widget to a dashboard.

  2. In the metric field, select datadog.estimated_usage.sds.scanned_bytes.

  3. In the from field, add !scanning_group_id:global to exclude the global scanning group.

  4. Set the space aggregation to sum and group by product and service.

  5. Apply the as_count() function to graph the scanned bytes in each interval. The resulting query is:

    sum:datadog.estimated_usage.sds.scanned_bytes{!scanning_group_id:global} by {product,service}.as_count()
    

Create a monitor on scanned volume

  1. Navigate to Monitors > New Monitor and select the Metric monitor type.

  2. In the Define the metric section, enter the same query:

    sum:datadog.estimated_usage.sds.scanned_bytes{!scanning_group_id:global} by {product,service}.as_count()
    
  3. Set the monitor query aggregation to sum and choose an evaluation window, for example the last 1 hour. The sum prefix in the query aggregates across tags only. By default, the monitor averages values over the window. Queries that use as_count() require sum to evaluate the total bytes in the window.

  4. In the Set alert conditions section, set a threshold in bytes for the evaluation window. To establish a baseline, review the scanned bytes for the same window size over 1-2 weeks, then set the threshold above that baseline.

  5. Configure notifications and add a monitor message that names the team responsible for the affected service.

Further reading