Add otel.sdk.processor.span.processed SDK self-observability metric
Merged
CI
3mo ago+863+863+012345678901234567890123456789-71-71-01234567890123456789
Adds otel.sdk.processor.span.processed to the built-in Simple and Batching span processors, mirroring #7486 which did the same for logs. Same meter, tag set and error.type values — see #7486 for the design rationale.
Three things that aren't obvious from the diff:
RECORD_ONLYspans are counted as successfully processed: they reach the processor and by design are never forwarded to an exporter. This follows the clarification proposed in open-telemetry/semantic-conventions#3978 — if that proposal is not accepted, this will be revisited.DROPspans are not counted, since the SDK never invokes processors for them.- Enqueue failures are counted via a new
internal virtual OnItemDropped()hook instead ofTryExport's return value, soOnEndcan keep calling the virtualOnExportand subclasses overriding it are still honored.BatchLogRecordExportProcessormoves onto the same hook, restoring its pre-#7486OnEndbody. - The shutdown barrier added to
BatchLogRecordExportProcessorin #7486 is lifted intoBatchExportProcessor<T>so both signals share it — the follow-up called out in that PR.
No public API change.