This demo runs a Go service instrumented with OpenTelemetry Auto SDK using Docker Compose. This requires no code changes. The Go auto-instrumentation container needs access to the app binary and host privileges to collect telemetry data automatically.
- Docker & Docker Compose installed
- Create a
.envfile (or copy from.env.example) with the following content:
OTEL_EXPORTER_OTLP_ENDPOINT=https://otel.kloudmate.com:4318
OTEL_EXPORTER_OTLP_TRACES_HEADERS="Authorization=<PRIVATE_KEY_FROM_KLOUDMATE>"
OTEL_SERVICE_NAME=golang-instrumentation-app
OTEL_GO_AUTO_TARGET_EXE=/app/service
OTEL_PROPAGATORS=tracecontext,baggageMore environment variables can be found from https://opentelemetry.io/docs/languages/sdk-configuration/
- Run the demo:
docker compose up --build- Access the Go app:
Open http://localhost:8080 or /health endpoint in your browser to generate some traces.
If you want to run without Docker on the same host, you first need to manually build the Go Auto Instrumentation binary and then run it alongside your Go application binary.
Refer to the official documentation for instructions: https://github.com/open-telemetry/opentelemetry-go-instrumentation/blob/main/docs/getting-started.md#instrument-an-application-on-the-same-host

