---
isPrivate: true
title: Configuring App Analytics via the Agent
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > APM > Tracing FAQ > Configuring App Analytics via the Agent
---

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

# Configuring App Analytics via the Agent

{% alert level="warning" %}
This page describes deprecated features with configuration information relevant to legacy App Analytics, useful for troubleshooting or modifying some old setups. To have full control over your traces, use [ingestion controls](https://docs.datadoghq.com/tracing/trace_ingestion.md) and [retention filters](https://docs.datadoghq.com/tracing/trace_retention.md) instead. Migrate to [Trace Retention and Ingestion ](https://docs.datadoghq.com/tracing/trace_pipeline.md)to use the new functionality.
{% /alert %}

[App Analytics](https://app.datadoghq.com/apm/services) is used to filter APM data by user-defined tags such as `customer_id`, `error_type`, or `app_name` to help troubleshoot and filter your requests. To enable it, either:

- Configure your Datadog SDK to emit the relevant analytics from your services—either [automatically](https://docs.datadoghq.com/tracing/app_analytics.md#automatic-configuration) or [manually](https://docs.datadoghq.com/tracing/app_analytics.md#custom-instrumentation).
- Configure the Datadog Agent to emit the relevant analytics from your services (instructions below).

**Note**: To enable App Analytics with the Agent, [services](https://app.datadoghq.com/apm/services) must be already flowing into Datadog.

1. Once [your services are set up](https://docs.datadoghq.com/tracing/send_traces.md), navigate to the [App Analytics docs page](https://app.datadoghq.com/apm/settings) to find a list of [services](https://docs.datadoghq.com/tracing/glossary.md#services) and [resource](https://docs.datadoghq.com/tracing/glossary.md#resources) names available for use in Trace Search.
1. Select the `environment` and `services` from which to extract [Indexed Spans](https://docs.datadoghq.com/tracing/app_analytics/search.md#analysed-span).
1. Update your Datadog Agent configuration (based on Agent version) with the information below:

{% tab title="Agent 6.3.0+" %}
In `datadog.yaml`, add `analyzed_spans` under `apm_config`. For example:

```yaml
apm_config:
  analyzed_spans:
    <SERVICE_NAME_1>|<OPERATION_NAME_1>: 1
    <SERVICE_NAME_2>|<OPERATION_NAME_2>: 1
```

{% /tab %}

{% tab title="Agent 5.25.0+" %}
In `datadog.conf`, add `[trace.analyzed_spans]`. For example:

```text
[trace.analyzed_spans]
<SERVICE_NAME_1>|<OPERATION_NAME_1>: 1
<SERVICE_NAME_2>|<OPERATION_NAME_2>: 1
```

{% /tab %}

{% tab title="Docker" %}
Add `DD_APM_ANALYZED_SPANS` to the Agent container environment (compatible with version 12.6.5250+). Format should be a comma-separated regular expressions without spaces. For example:

```text
DD_APM_ANALYZED_SPANS="<SERVICE_NAME_1>|<OPERATION_NAME_1>=1,<SERVICE_NAME_2>|<OPERATION_NAME_2>=1"
```

```text
`my-express-app|express.request=1,my-dotnet-app|aspnet_core_mvc.request=1`
```

{% /tab %}

In Datadog, every automatically instrumented service has an `<OPERATION_NAME>`, which is used to set the type of request being traced. For example, if you're tracing a Python Flask application, you might have a `flask.request` as your operation name. In a Node application using Express, you would have `express.request` ask your operation name.

Replace both the `<SERVICE_NAME>` and `<OPERATION_NAME>` in your configuration with the service name and operation name of the [traces](https://docs.datadoghq.com/tracing/glossary.md#trace) you want to add to Trace Search.

For example, if you have a Python service named `python-api`, and it's running Flask (operation name `flask.request`), your `<SERVICE_NAME>` would be `python-api`, and your `<OPERATION_NAME>` would be `flask.request`.
