Cloud Native 10 min read

Alibaba Cloud and Datadog Release OpenTelemetry Go Compile‑Time Instrumentation v1 for Zero‑Code Observability

The OpenTelemetry Go Compile‑Time Instrumentation project, jointly launched by Alibaba Cloud and Datadog, fills the last observability gap for Go by injecting tracing and metrics code at build time, offering zero‑code instrumentation, no runtime overhead, and seamless CI/CD integration while comparing it with manual and eBPF approaches.

Alibaba Cloud Native
Alibaba Cloud Native
Alibaba Cloud Native
Alibaba Cloud and Datadog Release OpenTelemetry Go Compile‑Time Instrumentation v1 for Zero‑Code Observability

Go has been the last mainstream language without zero‑code observability. In July 2026 the OpenTelemetry Go Compile‑Time Instrumentation project reached v1 stable, jointly initiated by Alibaba Cloud and Datadog, enabling Go applications to gain tracing and metric collection without modifying any business code.

Because Go compiles to a static binary without a VM, bytecode hooks, or class‑loading mechanisms, traditional agents cannot be attached. Developers are forced to choose between manual instrumentation—highly invasive and error‑prone—and eBPF external observation, which only sees L4/L7 traffic and lacks business‑level semantics.

Compile‑time instrumentation leverages the Go toolchain’s -toolexec extension. The process consists of four steps: (1) parse the package’s AST, (2) match registered instrumentation rules (e.g.,

net/http
ListenAndServe

), (3) inject tracing/metrics code into the matched functions, and (4) forward the transformed source to the original compile command. The resulting binary embeds the probe code, eliminating the need for sidecar agents, DaemonSets, or runtime instrumentation.

Unlike Java agents that rewrite bytecode at runtime with per‑class overhead, Go’s compile‑time approach incurs zero runtime cost—the binary is ordinary except for the built‑in tracing logic.

This method is CI/CD‑friendly: replace go build with otelc go build or set GOFLAGS='-toolexec=otelc toolexec' in the build pipeline, keeping existing build commands unchanged and preserving image size.

Version 1 focuses on five core libraries—net/http, gRPC, database/sql, and others—using a rule‑based architecture where each rule describes the package path, function signature, and code template to inject. Rules are community‑extensible, and all generated spans and metrics follow OpenTelemetry Semantic Conventions, ensuring consistent data across back‑ends such as Jaeger, Tempo, SLS, or ARMS.

Decision guidance:

If you can rebuild services and want zero‑code, low‑overhead observability → use compile‑time instrumentation.

If you have many legacy services or mixed‑language clusters and cannot rebuild → use eBPF (OBI) as a fallback.

If you need custom business spans (e.g., "order placed") → add manual instrumentation.

The project’s history illustrates a successful open‑source collaboration: in early 2025 Alibaba and Datadog discovered parallel internal efforts, formed a CNCF SIG, released a PoC, built a rule engine, test infrastructure, and expanded contributors via LFX Mentorship, culminating in the stable v1 release in Q3 2026.

Future roadmap includes adding instrumentation rules for Kafka, MongoDB, AWS SDK, integrating with the OpenTelemetry Registry, optimizing build‑time performance of otelc, and publishing more production case studies and benchmarks.

Platform engineers managing dozens of Go services can achieve the highest ROI with a single command that fully instruments all services. Library authors are encouraged to contribute new rules, which are far simpler than implementing full SDK wrappers.

Relevant resources:

Project repository:

github.com/open-telemetry/opentelemetry-go-compile-instrumentation

Getting‑started guide in the README

CNCF Slack channel: #otel-go-compile-instrumentation Related OpenTelemetry eBPF Instrumentation (OBI) project

OpenTelemetry Go instrumentation library

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Cloud NativeobservabilitygoopentelemetryeBPFZero-CodeCompile-Time Instrumentation
Alibaba Cloud Native
Written by

Alibaba Cloud Native

We publish cloud-native tech news, curate in-depth content, host regular events and live streams, and share Alibaba product and user case studies. Join us to explore and share the cloud-native insights you need.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.