監控
OTel Instrumentation Patterns
OpenTelemetry instrumentation patterns for Go 1.26+ microservices. Covers TracerProvider and MeterProvider setup with OTLP exporters, slog-based structured logging with trace correlation, HTTP/NATS middleware for automatic span creation, custom metric instruments (counters, histograms, gauges), tenant-scoped metric attributes, span enrichment, context propagation via NATS headers, and graceful shutdown of telemetry providers. Targets OTel SDK v1.28+ with Prometheus, Jaeger, and Loki backends. Keywords: OpenTelemetry, OTel, traces, metrics, logs, tracing, metering, instrumentation, span, TracerProvider, MeterProvider, OTLP, slog, Prometheus, Jaeger, Loki, Grafana, observability, tenant, correlation.