-mode flag:
Do not combine
WithObservabilityConfig with injected WithTracer / WithMetrics / WithLogs for the same signal unless you set DisableTraces, DisableMetrics, or DisableLogs on the observability config — otherwise the SDK replaces injected clients and logs a warning.
Source: examples/agent_with_observability/
OTLP environment
OTLP collector accepts gRPC (default) or HTTP/protobuf. Use host:port only (nohttp:// scheme).
Quick local collector
Grafana LGTM (traces, metrics, logs in one stack):Run
Fromexamples/:
Agent.Close() before exit so OTLP batches flush.
Verify in Grafana (LGTM)
- Open http://localhost:3000 — default login
admin/admin. - Traces — Explore → datasource Tempo → query by service or trace.
service.namefollows the agent name (e.g.observability-example-agent). - Metrics — Explore → Prometheus.
- Logs — Explore → Loki → filter by
service_namealigned with your OTLP resource.
Learn more
Tracing
Spans and OTLP setup
Metrics
Counters and histograms