Skip to content

Add guidance in README on how to set span attributes #123

Open
@adam-fowler

Description

@adam-fowler

Accessing span attributes is most likely accessed behind a lock. To avoid locking and unlocking continuously it is preferable span attributes are built up separate from the span and then set once on the span.

Eg replace

span.attributes["attr1"] = value1
span.attributes["attr2"] = value2
...

with

var attributes = span.attributes
attributes["attr1"] = value1
attributes["attr2"] = value2
...
span.attributes = attributes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions