Extend tracing and metrics

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>
This commit is contained in:
M.ShakhmatovandClaude Opus 5.5 committed 2026-11-15 16:39:08 +03:00
1 parent 2c83b28342
commit 022db31878
7 files changed
+572 -55

No files matched your search

+14
View File
@@ -1,5 +1,19 @@
# Changelog
## Unreleased
### Added
- `TracerConfig.Protocol` (`ProtocolGRPC` / `ProtocolHTTP`), `TracerConfig.TLS`, `TracerConfig.Environment`, `TracerConfig.Disabled`, `TracerConfig.Exporter`.
- `Trace`, `RecordError`, `TraceID` helpers.
- `Endpoint` accepts URLs (`https://collector:4318`).
- Resource carries `service.instance.id` and host attributes.
- Metrics: idempotent registration, `Sub`, `GaugeFunc`, `CounterFunc`, `RegisterDBStats`, OpenMetrics handler with trace exemplars.
### Changed
- Without `Endpoint` and `OTEL_EXPORTER_OTLP_*ENDPOINT`, spans are created and propagated but not exported (previously the exporter tried `localhost:4317`).
## v1.0.0
The API is stable from this release on (semantic versioning).