stdoutmetric observ: skip metric work when instruments are disabled by NesterovYehor · Pull Request #7868 · open-telemetry/opentelemetry-go (original) (raw)
Avoid unnecessary metric work in stdoutmetric exporter observability paths by Enabled() checks of metrics.
Benchmark
BenchmarkExportMetrics
Before: ~354 ns/op, 216 B/op, 2 allocs/op (error path)
After: ~55 ns/op, 0 B/op, 0 allocs/op
This change is internal and I think does not need to be mentioned in the changelog.
Issue: #7800