Skip to content

Add documentation for SpanAttributeKey #137

Open
@adam-fowler

Description

@adam-fowler

I only found this by mistake. It isn't obvious from the reference documentation how you would use this.

I'm assuming it works as follows.

extension SpanAttribute {
    var httpMethod: SpanAttributeKey<String> { .init(name: "http.method") }
}
span.attributes.httpMethod = .string("GET")

Is there anyway to get this to work

func setMethod(_ method: String) {
    span.attributes.httpMethod = method
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/documentationImprovements or additions to documentation.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions