Requests
- net/http, through otelhttp
- Any http.Handler
- Request headers, secrets redacted
- Request and response bodies (opt-in)
Go has no agent, so the WizeLens module sets up the OpenTelemetry SDK and the contrib instrumentation in a few lines. It adds what they leave out: SQL parameters, request headers, and bodies. Spans and logs go to your hub or the cloud over OTLP.
shutdown, err := wizelens.Start(ctx, wizelens.WithServiceName("inventory")) defer shutdown(context.Background()) db, err := wizelens.OpenDB("pgx", dsn, "postgresql") client := &http.Client{Transport: wizelens.Transport(nil)} log := wizelens.Logger("inventory", slog.Default().Handler()) http.ListenAndServe(":8080", wizelens.Handler(mux, "inventory"))
Everything below lands in the same trace as the request that caused it.
Point your OTLP HTTP exporters at WizeLens and the insights work on your spans. DBOptions adds SQL parameters to your own otelsql.Open call.
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:5960Without the values on each query, WizeLens cannot tell whether two queries were the same. OpenDB puts them on every query span.
Sample with WIZELENS_SAMPLE_RATE and WizeLens still keeps every trace with an error or a span of 1 second or more. Log lines are kept or dropped with their trace.
Set OTEL_EXPORTER_OTLP_ENDPOINT or any other OTEL_* variable and Start uses it. WIZELENS_ENABLED=false makes Start do nothing.
WIZELENS_ENABLED=false