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 1.11.0 of the Go tracing client, and can be enabled globally for all web integrations using:

  • the WithAnalytics (v2 documentation) tracer start option, for example:

    tracer.Start(tracer.WithAnalytics(true))
    
  • starting in version 1.26.0 using environment variable: DD_TRACE_ANALYTICS_ENABLED=true

Configure additional services (optional)

Configure by integration

In addition to the global setting, you can enable or disable App Analytics individually for each integration. As an example, for configuring the standard library’s net/http package, you could do:

package main

import (
    httptrace "gopkg.in/DataDog/dd-trace-go.v1/contrib/net/http" // 1.x
    "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer" // 1.x
    // httptrace "github.com/DataDog/dd-trace-go/contrib/net/http/v2" // 2.x
    // "github.com/DataDog/dd-trace-go/v2/ddtrace/tracer" // 2.x
)

func main() {
    tracer.Start()
    defer tracer.Stop()

    mux := httptrace.NewServeMux(httptrace.WithAnalytics(true))
    // ...
}

Database services

Database tracing is not captured by App Analytics by default. Enable collection manually for each integration, for example:

// Register the database driver with Analytics enabled.
sqltrace.Register("mysql", &mysql.MySQLDriver{}, sqltrace.WithAnalytics(true))
Custom instrumentation

For custom instrumentation, a special tag has been added to enable App Analytics on a span, as can be seen below:

span.SetTag(ext.AnalyticsEvent, true)

This marks the span as a App Analytics event.

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: aliciascott/DOCS-10399-move-CCM