CI / test (push) Failing after 43s
- Admin pprof is opt-in (AdminConfig.EnablePprof) - Client spans drop the URL query string; HostFunc bounds the host label - Config.HTTP/HTTPClient/GRPC configure the Observer's instrumentation - A panic after a partial HTTP response counts as 500 - GaugeFunc, CounterFunc and RegisterDBStats panic on duplicates - Abandoned client gRPC streams are recorded as Canceled - OTEL_EXPORTER_OTLP_PROTOCOL selects the protocol when unset - Health reports are cached for 1s; hung checks are not restarted - Environment is exported as deployment.environment.name Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
3.1 KiB
3.1 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.id, host attributes anddeployment.environment.name(fromEnvironment). New/Observer— one call wires logger, tracer, metrics, health checks and the admin server;Config.WithEnvappliesOBSX_*overrides.NewLogger,NewTraceHandler;NewHealth(liveness/readiness, HTTP andgrpc.health.v1).NewHTTPMiddleware,NewHTTPTransport,NewGRPCInterceptors— config-based instrumentation with fixed metric names (http_server_*,http_client_*,grpc_*).Config.HTTP,Config.HTTPClient,Config.GRPCconfigure the Observer's instrumentation;HTTPClientConfig.HostFuncbounds thehostlabel.OTEL_EXPORTER_OTLP_PROTOCOL/OTEL_EXPORTER_OTLP_TRACES_PROTOCOLselect the protocol whenTracerConfig.Protocolis empty.- Admin pprof is opt-in (
AdminConfig.EnablePprof,OBSX_ADMIN_ENABLE_PPROF). - Health reports are cached for one second and hung checks are not restarted; client spans omit the URL query string; abandoned client gRPC streams are recorded as
Canceled. deploy/— Grafana dashboard and Prometheus alerts;examples/service.- Metrics: idempotent registration,
Sub,GaugeFunc,CounterFunc,RegisterDBStats, OpenMetrics handler with trace exemplars.
Deprecated
HTTPMiddleware→NewHTTPMiddleware/Observer.HTTPMiddleware. It keeps working with its v1.0.0 metric names (<ns>_http_requests_total,<ns>_http_request_duration_seconds).HTTPTransport→NewHTTPTransport;LogHandler→NewTraceHandler. Both now delegate to the new implementations.
Changed
HTTPTransportclient spans carryserver.addresswithout the port and addurl.full(credentials stripped).- 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).