---
title: Monitor Sensitive Data Scanner Usage
description: >-
  Graph and alert on the volume of data Sensitive Data Scanner scans, broken
  down by product and service, using the scanned bytes estimated usage metric.
breadcrumbs: >-
  Docs > Datadog Security > Sensitive Data Scanner > Sensitive Data Scanner
  Guides > Monitor Sensitive Data Scanner Usage
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Monitor Sensitive Data Scanner Usage

## Overview{% #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](https://docs.datadoghq.com/account_management/billing/usage_metrics.md). 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:

{% dl %}

{% dt %}
`product`
{% /dt %}

{% dd %}
The product the scanned data comes from: Logs, APM, RUM, or Events.
{% /dd %}

{% dt %}
`service`
{% /dt %}

{% dd %}
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.
{% /dd %}

{% dt %}
`scanning_group_id`
{% /dt %}

{% dd %}
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.
{% /dd %}

{% /dl %}

## Prerequisites{% #prerequisites %}

Before you start, verify you have:

- Sensitive Data Scanner configured with scanning groups and scanning rules. See [Set up Sensitive Data Scanner](https://docs.datadoghq.com/security/sensitive_data_scanner.md) for more information.
- [Permissions](https://docs.datadoghq.com/account_management/rbac/permissions.md) to create dashboards or monitors.

## Graph scanned volume by product and service{% #graph-scanned-volume-by-product-and-service %}

1. Navigate to the [Metrics Explorer](https://app.datadoghq.com/metric/explorer), or add a timeseries widget to a [dashboard](https://docs.datadoghq.com/dashboards.md).

1. In the metric field, select `datadog.estimated_usage.sds.scanned_bytes`.

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

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

1. 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{% #create-a-monitor-on-scanned-volume %}

1. Navigate to [Monitors > New Monitor](https://app.datadoghq.com/monitors/create/metric) and select the Metric monitor type.

1. 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()
   ```

1. 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.

1. 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.

1. Configure [notifications](https://docs.datadoghq.com/monitors/notify.md) and add a monitor message that names the team responsible for the affected service.

## Further reading{% #further-reading %}

Additional helpful documentation, links, and articles:

- [Learn more about estimated usage metrics](https://docs.datadoghq.com/account_management/billing/usage_metrics.md)
- [Set up Sensitive Data Scanner](https://docs.datadoghq.com/security/sensitive_data_scanner.md)
- [Learn more about the Metrics Explorer](https://docs.datadoghq.com/metrics/explorer.md)
- [Learn to set up metric monitors](https://docs.datadoghq.com/monitors/types/metric.md)
