Skip to content

OTel span events may drop None-valued attributes with a warning #171

Closed

Description

@lesnik512

_emit_event passes the attributes dict to span.add_event unchanged. Some events can carry None values, for example last_status on retry.giving_up when the last attempt raised instead of returning a response (src/httpware/middleware/resilience/retry.py). The OpenTelemetry SDK does not accept None as an attribute value. As far as I know it drops the attribute and logs a warning, which would mean one warning on every such give-up.

This was not run end to end: the OTel SDK is not installed in the dev environment.

How to confirm: install opentelemetry-sdk, set up a TracerProvider with an in-memory exporter, start a span, and drive a Retry to give up on a raised NetworkError. Check whether the SDK logs a warning and whether last_status is missing from the recorded event.

If it reproduces, the fix is to drop None values from the span-event attributes in _emit_event and keep them in the log record.

Activity

  1. added
    bugSomething isn't working
    needs-triageMaintainer needs to evaluate this issue
    on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageMaintainer needs to evaluate this issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions