Tracing: OTLP gRPC/HTTP exporters with TLS and headers, parent-based sampling, W3C TraceContext/Baggage propagation, richer resource attributes, no-export mode without an endpoint, Disabled flag, and Trace/RecordError/TraceID helpers. Metrics: idempotent registration, Sub, GaugeFunc, CounterFunc, RegisterDBStats, OpenMetrics handler with trace exemplars. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1.6 KiB
1.6 KiB
Changelog
Unreleased
Added
TracerConfig.Protocol(ProtocolGRPC/ProtocolHTTP),TracerConfig.TLS,TracerConfig.Environment,TracerConfig.Disabled,TracerConfig.Exporter.Trace,RecordError,TraceIDhelpers.Endpointaccepts URLs (https://collector:4318).- Resource carries
service.instance.idand host attributes. - Metrics: idempotent registration,
Sub,GaugeFunc,CounterFunc,RegisterDBStats, OpenMetrics handler with trace exemplars.
Changed
- Without
EndpointandOTEL_EXPORTER_OTLP_*ENDPOINT, spans are created and propagated but not exported (previously the exporter triedlocalhost:4317).
v1.0.0
The API is stable from this release on (semantic versioning).
Added
HTTPMiddleware— server spans with trace continuation plushttp_requests_totalandhttp_request_duration_secondsmetrics.HTTPTransport— client spans and trace context propagation for outgoing requests.LogHandler—slog.Handlerwrapper addingtrace_id/span_idto records.TracerConfig.Insecure,TracerConfig.Headers,TracerConfig.Attributes.SetupTracerinstalls W3C TraceContext + Baggage propagators and honoursOTEL_EXPORTER_OTLP_*/OTEL_RESOURCE_ATTRIBUTES.
Changed (breaking since v0.2.0)
- OTLP connection uses TLS by default. Set
TracerConfig.Insecure: truefor plaintext collectors — previously the connection was always insecure. - Sampling is parent-based:
Samplerapplies to root traces, child spans follow the parent's decision. StartSpaninstrumentation scope isgit.codelab.vc/pkg/obsx(wasobsx).