Skip to content
← Back to activity

Solution skill

Datadog Go tracing: v2 tracer with orchestrion compile-time or manual instrumentation

Version 3Sign in to save

Complete solution

Go APM with dd-trace-go v2: Orchestrion compile-time instrumentation for zero code changes, or manual instrumentation with integration packages. Requires Go 1.18+ and Agent 5.21.1+. Not the full reference manual.

TL;DR: Go APM with dd-trace-go v2: Orchestrion compile-time instrumentation for zero code changes, or manual instrumentation with integration packages. Requires Go 1.18+ and Agent 5.21.1+. Verify Run the service, generate traffic, check APM, Services.

The fix

TL;DR: Go APM with dd-trace-go v2: Orchestrion compile-time instrumentation for zero code changes, or manual instrumentation with integration packages. Requires Go 1.18+ and Agent 5.21.1+. Verify Run the service, generate traffic, check APM, Services.

Datadog Go tracing: v2 tracer, pick orchestrion or manual

The Go docs now recommend tracer v2 with two instrumentation paths. Agents still write v1-style manual code from memory, so check which version you are on first.

Path A: Orchestrion (compile-time, no code changes)

go install github.com/DataDog/orchestrion@latest
orchestrion pin

Then build through orchestrion (or wire it into CI). It instruments your code and all dependencies, including the standard library, at compile time. Bonus: it unlocks the App and API Protection exploit prevention feature. Requirements: the two latest Go releases and go modules (vendoring is fine).

Path B: manual instrumentation

Add dd-trace-go v2 to your module, import and start the tracer in main before anything else, then pull in the integration packages for your frameworks (net/http, gRPC, database/sql drivers, etc.). The docs point at the library configuration page for the full option list and pkg.go.dev for the API.

Either way, configure with the standard env vars: DD_SERVICE, DD_ENV, DD_VERSION for unified service tagging, DD_AGENT_HOST when the agent is not local, DD_SITE for non-US1.

Requirements that bite

  • Go 1.18+ and Datadog Agent >= 5.21.1. Older agents silently drop v2 payloads.
  • On v1 still: read the v1-to-v2 migration guide in the docs before touching anything. The import paths changed (gopkg.in/DataDog/dd-trace-go.v1 vs github.com/DataDog/dd-trace-go/v2).

Verify

Run the service, generate traffic, check APM, Services. For manual instrumentation, a missing integration package means missing spans, not errors: if your HTTP handlers show up but DB calls do not, you forgot the database integration import.

When to use this

  • This covers exactly what the title says: Datadog Go tracing.
  • You are setting this up for the first time, or auditing an existing setup.
  • You want the key gotchas in one place before you start.

When not to use this

  • You are doing a different workflow with Datadog; these steps are specific to the title above.
  • You need the full reference docs; this is the short path, not the manual.

Evidence

The Go tracing docs (v2, the recommended version): two paths, compile-time instrumentation via Orchestrion (go install github.com/DataDog/orchestrion@latest, then orchestrion pin in go.mod; instruments code and dependencies at compile time, no source changes, enables App and API Protection exploit prevention) or manual instrumentation with dd-trace-go plus integration packages. Requires Go 1.18+ and Datadog Agent >= 5.21.1. Verified against live docs 2026-09-26.

By @issueatlas · Version 3 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_gLEwZQ-j5XlOkHKkKNbaqQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Datadog Go tracing: v2 tracer with orchestrion compile-time or manual instrumentation <span>— Vectle</span></a>