slashmo / gsoc-swift-tracing

WIP collection of Swift libraries enabling Tracing on Swift (Server) systems.
https://summerofcode.withgoogle.com/projects/#6092707967008768
Apache License 2.0
20 stars 1 forks source link

Consider grouping span attribute names in namespaces #135

Closed pokryfka closed 4 years ago

pokryfka commented 4 years ago

Just an idea...

I think this would compose better (plus much nicer generated documentation and autocompletion support):

extension SpanAttributeName {
    /// Semantic conventions for HTTP spans.
    public enum HTTP {
        public static let method = "http.method"
        public static let url = "http.url"
    }
}

than

extension SpanAttributeName {
    public static let httpMethod = "http.method"
    public static let httpURL = "http.url"
}
ktoso commented 4 years ago

Sounds good, that's not too much maintanance overhead thankfully. We only didn't want to copy all the docs to both the strings and real attributes, this should be good to do tho 👍

slashmo commented 4 years ago

@pokryfka Yeah, I like that too. Thanks for the suggestion 👍