1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-11-25 22:41:46 +02:00

sdk/trace: self-observability: batch span processor metrics (#6393)

Fixes https://github.com/open-telemetry/opentelemetry-go/issues/7005

Adds `otel.sdk.processor.span.queue.size`,
`otel.sdk.processor.span.queue.capacity`, and
`otel.sdk.processor.span.processed.count` metrics to the trace batch
span processor.

These are defined in
cb11bb9bac/docs/otel/sdk-metrics.md,
and are experimental. Because of this, metrics are behind the
OTEL_GO_X_SELF_OBSERVABILITY feature gate.

Given the feature is experimental, it always uses the global
meterprovider when enabled.

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
This commit is contained in:
David Ashpole
2025-08-11 16:15:00 -04:00
committed by GitHub
parent c5e68b2010
commit fcc3417677
5 changed files with 359 additions and 4 deletions

View File

@@ -39,7 +39,7 @@ func (tr *tracer) initSelfObservability() {
tr.selfObservabilityEnabled = true
mp := otel.GetMeterProvider()
m := mp.Meter("go.opentelemetry.io/otel/sdk/trace",
m := mp.Meter(selfObsScopeName,
metric.WithInstrumentationVersion(sdk.Version()),
metric.WithSchemaURL(semconv.SchemaURL))