Go Monitoring
Go monitoring,
with or without changing code.
Wire the OpenTelemetry SDK into your service for traces from net/http, gRPC and database/sql. Or capture HTTP, gRPC and database traffic from the kernel with axonIQzerocode, with no rebuild at all.
What you see
Traces, metrics and logs from Go
Go has no runtime agent: the SDK is initialised in main, or axonIQzerocode observes the binary from the kernel.
Distributed traces
Handlers, gRPC calls and queries as spans through the official contrib instrumentation.
Runtime metrics
Goroutines, memory and garbage collection from the runtime instrumentation package.
Zero-code option
axonIQzerocode reconstructs HTTP, gRPC and database calls from any Go binary with eBPF.
Frameworks and libraries
Each of these has official OpenTelemetry instrumentation. aiAxonIQ receives it over OTLP, so anything the OpenTelemetry project adds for Go works here too.
- net/http
- gRPC
- database/sql
- Gin
- Echo
- gorilla/mux
- Sarama (Kafka)
- go-redis
- AWS SDK
Set up
Send Go telemetry in three steps
The full guide, including sampling and resource attributes, is in the documentation.
1Install
go get go.opentelemetry.io/otel \ go.opentelemetry.io/otel/sdk \ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttpGo has no runtime agent, the SDK is wired up in code. The environment variables below are still read by the exporter, so configuration stays identical to every other target.
2Configure
export OTEL_EXPORTER_OTLP_ENDPOINT="https://app.aiaxoniq.com/otlp" export OTEL_EXPORTER_OTLP_HEADERS="x-license-key=YOUR_LICENSE_KEY" export OTEL_SERVICE_NAME="my-service"3Run
go run .
How the data flows
- 1. Instrument. The OpenTelemetry SDK for Go records spans, metrics and logs in your process.
- 2. Export. It sends them over OTLP, straight to aiAxonIQ or through an OpenTelemetry Collector you already run.
- 3. Explore. Traces, metrics and logs land in one store, so a slow request opens onto its queries and its log lines.
Because the wire format is OTLP, the same instrumentation works with any OpenTelemetry backend. Moving to aiAxonIQ, or away from it, is an endpoint change.
Go questions
- Do I have to rebuild my service?
- With the SDK, yes: instrumentation is compiled in. With axonIQzerocode, no: it observes the running binary from the kernel.
- What does zero-code need from the host?
- A Linux kernel 5.4 or later with BTF, which covers current releases of the major distributions and managed Kubernetes node images.