App Analytics

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 and retention filters instead.

Migrate to the new configuration options

Navigate to the ingestion control page to see services with legacy configurations. These are flagged with a Legacy Setup status.

To migrate to the new configuration options, remove all legacy App Analytics configuration options from the services flagged with Legacy Setup. Then, implement the Datadog Agent and tracing libraries’ sampling mechanisms to send traces.

App Analytics setup

App Analytics configuration options are located in the Tracing Libraries and in the Datadog Agent. In the libraries, analytics spans from your services are generated either automatically or manually.

In Tracing Libraries

Automatic configuration

App Analytics is available starting in version 0.19.0 of the Ruby tracing client, and can be enabled for all web integrations with a global flag.

To do so, set either DD_TRACE_ANALYTICS_ENABLED=true in your environment, or configure with:

Datadog.configure { |c| c.tracing.analytics.enabled = true }
  • true enables analytics for all web frameworks.
  • false or nil disables analytics, except for integrations that explicitly enable it. (Default)

Configure additional services (optional)

Configure by integration

App Analytics can be enabled for specific integrations.

To do so, set either DD_<INTEGRATION>_ANALYTICS_ENABLED=true in your environment, or configure with:

Datadog.configure { |c| c.tracing.instrument :integration, analytics_enabled: true }

Where integration is the name of the integration. See the list of available integrations for options.

  • true enables analytics for this integration, regardless of the global setting.
  • false disables analytics for this integration, regardless of the global setting.
  • nil defers to global setting for analytics.

Database services

Database tracing is not captured by App Analytics by default and you must enable collection manually for each integration. For example:

Datadog.configure { |c| c.tracing.instrument :mongo, analytics_enabled: true }
Custom instrumentation

Applications with custom instrumentation can enable App Analytics by setting the Analytics::TAG_ENABLED tag on a span:

Datadog::Tracing.trace('my.task') do |span|
  # Set the analytics sample rate to 1.0
  span.set_tag(Datadog::Tracing::Metadata::Ext::Analytics::TAG_ENABLED, true)
end

In the Datadog Agent

This section describes deprecated features with configuration information relevant to legacy App Analytics.

To configure a rate of spans to analyze by service, setup the following in the datadog.yaml file:

apm_config:
  analyzed_rate_by_service:
    service_A: 1
    service_B: 0.2
    service_C: 0.05

To configure a rate of spans to analyze by service and operation name, setup the following in the datadog.yaml file:

apm_config:
  analyzed_spans:
    service_A|operation_name_X: 1
    service_A|operation_name_Y: 0.25
    service_B|operation_name_Z: 0.01

Troubleshooting: Maximum events per second limit

If you encounter the following error message in your Agent logs, your applications are emitting more than the default 200 trace events per second allowed by APM.

Max events per second reached (current=300.00/s, max=200.00/s). Some events are now being dropped (sample rate=0.54). Consider adjusting event sampling rates.

To increase the APM rate limit for the Agent, configure the max_events_per_second attribute within the Agent’s configuration file (underneath the apm_config: section). For containerized deployments (for example, Docker or Kubernetes), use the DD_APM_MAX_EPS environment variable.

Note: Increasing the APM rate limit could result in increased costs for App Analytics.

PREVIEWING: brett.blue/reorg-otel