Skip to content

Instantly share code, notes, and snippets.

@up1
Last active May 6, 2025 06:32
Show Gist options
  • Save up1/2dfcaa77be36bddd79d5e197f484b154 to your computer and use it in GitHub Desktop.
Save up1/2dfcaa77be36bddd79d5e197f484b154 to your computer and use it in GitHub Desktop.
Go-A/uto Instrumentation
services:
go-api:
build:
context: ./api-go
dockerfile: Dockerfile
pid: "host"
ports:
- 1323:1323
volumes:
- /proc:/host/proc
services:
go-auto:
image: otel/autoinstrumentation-go
privileged: true
pid: "host"
environment:
- OTEL_EXPORTER_OTLP_ENDPOINT=http://lgtm:4318
- OTEL_GO_AUTO_TARGET_EXE=/app/main
- OTEL_SERVICE_NAME=go-auto-api
- OTEL_PROPAGATORS=tracecontext,baggage
- OTEL_GO_AUTO_INCLUDE_DB_STATEMENT=true
- OTEL_GO_AUTO_PARSE_DB_STATEMENT=true
- CGO_ENABLED=1
volumes:
- /proc:/host/proc
services:
lgtm:
image: grafana/otel-lgtm:0.8.1
container_name: lgtm
restart: always
ports:
- 3000:3000
- 4317:4317
- 4318:4318
environment:
- GF_PATHS_DATA=/data/grafana
volumes:
- ./lgtm/grafana:/data/grafana
- ./lgtm/prometheus:/data/prometheus
- ./lgtm/loki:/data/loki
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment