Skip to content

NoOpTracer still sets up attributes when calling Span.updateAttributes #189

@adam-fowler

Description

@adam-fowler

When you call Span.updateAttributes(_:) on a NoOpSpan the included closure shouldn't be called. This is the cause of unexpected allocations when the tracer has been set to NoOp.

Is adding the function to the protocol a breaking change if you provide a default implementation?

Not calling the closure could be considered a breaking change I suppose given people might do other stuff inside that closure.

Ideally SpanAttributes would be an associatedtype and the NoOpSpan would have its own version that didn't do anything, but I think that ship may have sailed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions