Alpha

Every Go request, in a few lines.

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.

1 module
the OpenTelemetry SDK and contrib, set up
5 calls
Start, OpenDB, Transport, Logger, Handler
v0.1.0
out now with go get
main.go
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"))
GET /orders · 84 ms
GET /orders84 ms
SELECT id, customer_id FROM orders WHERE status = $12.3 ms
SELECT sku, qty FROM order_items WHERE order_id = $11.4 ms
GET pricing/prices?sku=…41 ms
info loaded 12 orders

What gets captured.

Everything below lands in the same trace as the request that caused it.

Requests

  • net/http, through otelhttp
  • Any http.Handler
  • Request headers, secrets redacted
  • Request and response bodies (opt-in)

Databases

  • database/sql, through otelsql
  • Any driver, such as pgx or sqlite
  • One span per query, named by its first word
  • SQL parameters, sensitive names redacted

Calls out

  • http.Client, through Transport
  • W3C trace context to the next service

Logs

  • log/slog, through otelslog
  • Your own slog handler still writes
  • Each line with its trace (InfoContext and friends)

Insights

  • N+1 queries
  • N+1 HTTP calls
  • Duplicate queries
  • Slow queries
  • Database waits

Packages

  • Every Go module in the build
  • Checked against OSV on the hub and cloud
  • Off with WIZELENS_PACKAGES=false

Plain OpenTelemetry, with the gaps filled.

Already on OpenTelemetry?

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:5960

Parameters make duplicates visible.

Without the values on each query, WizeLens cannot tell whether two queries were the same. OpenDB puts them on every query span.

Errors and slow traces stay.

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.

Your OTEL_* settings win.

Set OTEL_EXPORTER_OTLP_ENDPOINT or any other OTEL_* variable and Start uses it. WIZELENS_ENABLED=false makes Start do nothing.

WIZELENS_ENABLED=false

Mixing stacks? One trace across all of them.

A Vue front end, a .NET gateway, a Node service, and a Python worker join the same trace, and the same insights run on all of it.