apple / apple/swift-distributed-tracing

Add documentation for SpanAttributeKey

Open
#137 0 comments 0 reactions 0 assignees View on GitHub
area/documentation
Dominant language
Swift
Stars
320
Forks
57
Avg merge
4d 5h
Merged PRs (30d)
1

Description

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.
```swift
extension SpanAttribute {
var httpMethod: SpanAttributeKey { .init(name: "http.method") }
}
span.attributes.httpMethod = .string("GET")
```
Is there anyway to get this to work
```swift
func setMethod(_ method: String) {
span.attributes.httpMethod = method
}
```

Contributor guide

Open the contributing guide

Research direction

Start by locating the SpanAttributeKey declaration and its reference documentation in the repository. Review the existing SpanAttribute examples, then document the shown usage and clarify whether assigning a plain String to span.attributes.httpMethod is supported. Done means the reference documentation explains both forms or clearly states the supported alternative.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.