Skip to content

Release Notes v0.12.0

Release Date: July 2026

Highlights

  • observops.Setup — a one-call bootstrap that wires metrics, traces, and logs and returns native OpenTelemetry handles, plus a Prometheus /metrics handler and HTTP middleware. Consumers instrument with the standard OTel API and keep full ecosystem interop; observops owns only the wiring.

Added

Setup bootstrap

observops.Setup(ctx, opts...) returns a *Telemetry:

Field Type Purpose
Tracer trace.Tracer Native OTel tracer
Meter metric.Meter Native OTel meter (int64/float64, sync/observable)
Logger *slog.Logger Console + OTel logs; installed as slog.Default()
MetricsHandler http.Handler Prometheus scrape handler (nil unless WithPrometheus)
TracerProvider / MeterProvider / LoggerProvider SDK providers Advanced use
tel, err := observops.Setup(ctx,
    observops.WithServiceName("my-service"),
    observops.WithPrometheus(),               // pull: tel.MetricsHandler
    observops.WithEndpoint("localhost:4317"), // push: OTLP gRPC
    observops.WithInsecure(),
)
if err != nil {
    log.Fatal(err)
}
defer tel.Shutdown(context.Background())

mux.Handle("/metrics", tel.MetricsHandler)
handler = tel.Middleware("api")(handler)

Composable exporters and signals

  • Metrics, traces, and logs are enabled by default; disable any with WithMetrics, WithTraces, or WithLogs.
  • Prometheus pull (WithPrometheus) and OTLP push (WithEndpoint, WithOTLPOverHTTP) can be used together; WithStdout mirrors to stdout for debugging.
  • Logs are exported through the real OpenTelemetry log SDK via the otelslog bridge — not as span events.

HTTP instrumentation

  • Telemetry.Middleware(operation) wraps an http.Handler with server spans and metrics.
  • Telemetry.Transport(base) wraps an http.RoundTripper with client spans and context propagation.

Relationship to the driver registry

The existing vendor-neutral driver registry (Open("otlp"|"datadog"|"newrelic"|"dynatrace")) is unchanged. Setup is the recommended entry point for services that want native OTel handles; the driver registry remains for vendor-switching behind the observops interfaces. The package documentation has been corrected to describe the two entry points accurately.

Dependencies

  • OpenTelemetry logs: go.opentelemetry.io/otel/sdk/log v0.20.0, otel/log v0.20.0, otel/exporters/otlp/otlplog/{otlploggrpc,otlploghttp} v0.20.0
  • go.opentelemetry.io/otel/exporters/prometheus v0.66.0; stdout exporters (stdouttrace/stdoutmetric v1.44.0, stdoutlog v0.20.0)
  • go.opentelemetry.io/contrib/bridges/otelslog v0.19.0; contrib/instrumentation/net/http/otelhttp v0.69.0