Add otel.sdk.processor.span.processed SDK self-observability metric

Merged
CI
3mo ago
+863-71

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_ONLY spans 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. DROP spans are not counted, since the SDK never invokes processors for them.
  • Enqueue failures are counted via a new internal virtual OnItemDropped() hook instead of TryExport's return value, so OnEnd can keep calling the virtual OnExport and subclasses overriding it are still honored. BatchLogRecordExportProcessor moves onto the same hook, restoring its pre-#7486 OnEnd body.
  • The shutdown barrier added to BatchLogRecordExportProcessor in #7486 is lifted into BatchExportProcessor<T> so both signals share it — the follow-up called out in that PR.

No public API change.