Datadog trace function - unix1998/technical_notes GitHub Wiki

For Datadog tracing, it has two main options: using Datadog’s own instrumentation libraries (APM) or using OpenTelemetry. Here’s an overview of both approaches:

1. Datadog Instrumentation Agent

Datadog provides its own instrumentation libraries and agents for various programming languages, which are tailored to work seamlessly with Datadog's APM (Application Performance Monitoring). These libraries automatically instrument your applications to collect traces and send them to Datadog.

  • Languages Supported: Datadog offers instrumentation libraries for many languages, including Java, Python, Node.js, Ruby, .NET, Go, PHP, and others.
  • Automatic Instrumentation: The libraries provide automatic instrumentation for many common libraries and frameworks, making it easy to get started with minimal configuration.
  • Customization: You can customize the instrumentation to capture additional spans or add metadata to your traces.

2. OpenTelemetry

OpenTelemetry is an open-source project that provides a set of APIs, libraries, agents, and instrumentation to enable observability (tracing, metrics, and logging) in your applications. You can use OpenTelemetry to collect traces and send them to Datadog.

  • Flexibility: OpenTelemetry is vendor-neutral and allows you to switch between different observability backends, including Datadog.
  • Instrumentation: OpenTelemetry provides libraries and agents for automatic and manual instrumentation of your applications.
  • Exporters: You need to configure the OpenTelemetry Collector or SDK to use the Datadog exporter, which will send the collected traces to Datadog.

Choosing Between Datadog APM and OpenTelemetry

  • Simplicity: If you are already using Datadog and want a straightforward setup with minimal configuration, Datadog’s own instrumentation libraries are a good choice.
  • Flexibility and Portability: If you prefer a vendor-neutral approach or are using multiple observability tools, OpenTelemetry offers greater flexibility and portability.

Summary

  • Datadog Instrumentation Agent: Provides an easy and integrated way to collect traces and send them to Datadog.
  • OpenTelemetry: Offers a flexible and vendor-neutral approach to collecting traces, which can be exported to Datadog using the appropriate exporters.

You can choose the option that best fits your needs and existing infrastructure. Both methods will allow you to collect and analyze traces within the Datadog platform.