go_otel_auto_instrument
let's you automatically instrument your Go code with Opentelemtry.
To use go-otel-auto-instrument
in your build process, install it as a binary executable:
go install github.com/pijng/go_otel_auto_instrument/cmd/go-otel-auto-instrument@latest
To use the go_otel_auto_instrument
library in your Go project, add it via Go modules:
go get github.com/pijng/go_otel_auto_instrument
go mod tidy
package main
import (
_ "github.com/pijng/go_otel_auto_instrument"
)
To automatically instrument your Go code run the command:
go build -toolexec="go-otel-auto-instrument" main.go
OTEL_SERVICE_NAME="My Service" OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 ./main