Skip to content

Define a self-observability Event for SDK component shutdown (starting with BatchSpanProcessor) #3718

Description

@cijothomas

There is no standardized Event today for "an SDK component (e.g. BatchSpanProcessor) has shut down." Each SDK does its own thing:

This is naturally event-shaped: it happens once at a specific moment, the payload is a one-shot record (outcome + final dropped count), and a metric can't really answer "did my pipeline drain cleanly at container shutdown?". A standardized Event (general semantics) lets every SDK emit the same well-known signal.

Starting with spans avoids the log self-feedback concern (a log event reporting log-pipeline drops would route through the failing pipeline). This is intended as the first of a series of self-observability Events; others (cardinality limit reached, runtime data-loss markers, lifecycle events) will be proposed once this lands.

Proposal

Event name: otel.sdk.component.shutdown

The component is identified via the existing otel.component.* attributes, not in the event name.

Attribute Status Notes
otel.component.type existing initial scope: batching_span_processor
otel.component.name existing e.g. batching_span_processor/0
outcome new success / failed / timed_out
dropped count new total items dropped over the component's lifetime

Severity: WARN if outcome != success or dropped > 0, INFO otherwise.

Body: not used (per Event guidelines).

Open questions

  1. One event name with variable severity (above), or two event names like .NET (shutdown + shutdown_with_loss)?
  2. Outcome: reuse otel.status_code (OK/ERROR) or new attribute that distinguishes timed_out?
  3. Routing: the LogRecord can't safely flow through the user's LoggerProvider if it's also shutting down. Spec PR Reference semantic conventions for SDK self-observability metrics opentelemetry-specification#5087 is the natural home for this guidance.
  4. Include exported_count and/or shutdown_duration as attributes?

Related

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    Need triage
    Status
    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions