Install Backend Error Tracking Using Datadog Tracing Libraries

このページは日本語には対応しておりません。随時翻訳に取り組んでいます。
翻訳に関してご質問やご意見ございましたら、お気軽にご連絡ください

To instrument your application with Datadog libraries:

  1. Install and configure the Agent.
  2. Add the Datadog tracing library to your code.

Install and configure the Agent

Install the Datadog Agent by following the relevant documentation.

To configure the agent for Error Tracking Backend only, you must be running Agent v7.61+.

  1. Open the datadog.yaml configuration file.

  2. Add core_agent and apm_config as top-level attributes anywhere in the configuration file with the following settings:

    core_agent:
      enabled: false
    apm_config:
      error_tracking_standalone:
        enabled: true
    
  3. Restart the Agent.

If you’re using the Docker containerized Agent, set the following environment variables:

  • DD_CORE_AGENT_ENABLED=false
  • DD_APM_ERROR_TRACKING_STANDALONE_ENABLED=true

Here’s an example of how you can include these settings in your Docker run command:

docker run -d --name datadog-agent \
           --cgroupns host \
           --pid host \
           -e DD_API_KEY=<DATADOG_API_KEY> \
           -e DD_CORE_AGENT_ENABLED=false \
           -e DD_APM_ERROR_TRACKING_STANDALONE_ENABLED=true \
           -v /var/run/docker.sock:/var/run/docker.sock:ro \
           -v /proc/:/host/proc/:ro \
           -v /opt/datadog-agent/run:/opt/datadog-agent/run:rw \
           -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
           gcr.io/datadoghq/agent:latest

If you’re deploying the Agent in Kubernetes, make the following changes in your Helm chart in addition to your Agent configuration:

agents:
  containers:
    agent:
      env:
        - name: DD_CORE_AGENT_ENABLED
          value: "false"
datadog:
[...]
  processAgent:
    enabled: false
    containerCollection: false
[...]
  apm:
    errorTrackingStandalone:
      enabled: true

Instrument your application

Follow the relevant documentation to set up your application to send traces using one of the official Datadog tracing libraries. Follow the OpenTelemetry API guide for your application language to manually send errors through span events.

Further Reading

PREVIEWING: teddy.gesbert/doc-dora