Skip to content

Semantic attribute fix#5

Merged
bryce-b merged 15 commits intoopen-telemetry:mainfrom
bryce-b:semantic-attribute-fix
Sep 8, 2025
Merged

Semantic attribute fix#5
bryce-b merged 15 commits intoopen-telemetry:mainfrom
bryce-b:semantic-attribute-fix

Conversation

@bryce-b
Copy link
Member

@bryce-b bryce-b commented Sep 2, 2025

This PR updates the semantic attribute generation to use the new weaver toolset.
I'm not entirely sure which semconv namespaces we should target, please review and we can discuss which are unnecessary to include (e.g.: we probably don't need to include Webengine)

After conversing with the semconv group in slack, I've decided to leave the original files OpenTelemetryApi/Trace/SemanticAttribute.swift and OpenTelemetrySdk/Resources/ResourceAttributes.swift for backwards compatibility.
Note that semconv are no longer organized by signal types so this original structure is obsolete.
I've opted to create a new structure under OpenTelemetryApi/Common/SemanticConventions
The new enums can be accessed through the class SemanticConventions extended by semconv namespaces, eg: SemanticConventions.Andorid.<etc>

Here is an example of the documentation generated:
Screenshot 2025-09-03 at 11 56 46

@bryce-b bryce-b force-pushed the semantic-attribute-fix branch 2 times, most recently from 96b7dd6 to 9cfa46a Compare September 2, 2025 20:00
@bryce-b bryce-b force-pushed the semantic-attribute-fix branch 2 times, most recently from 22a459b to f81c258 Compare September 2, 2025 23:57
@bryce-b bryce-b force-pushed the semantic-attribute-fix branch 6 times, most recently from 213eb1d to 68b2f19 Compare September 3, 2025 15:49
@bryce-b bryce-b force-pushed the semantic-attribute-fix branch from 68b2f19 to cfd0f3c Compare September 3, 2025 15:57
@bryce-b bryce-b force-pushed the semantic-attribute-fix branch from b81965d to 234a636 Compare September 3, 2025 17:50
@bryce-b bryce-b force-pushed the semantic-attribute-fix branch 2 times, most recently from 0609cb8 to 0b44e42 Compare September 3, 2025 18:20
@bryce-b bryce-b force-pushed the semantic-attribute-fix branch from 0b44e42 to d1cd528 Compare September 3, 2025 18:22
@bryce-b bryce-b marked this pull request as ready for review September 4, 2025 14:16
added deprecation messages to ResourceAttributes & SemanticAttributes
}
}
}
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added these convenience methods to allow the use of SemanticConventions without having to use rawValue everywhere. We might consider bringing this into the main framework, rather than just the tests.

@nachoBonafonte
Copy link
Member

Keeping the previous files for compatibility but annotated is a great idea

@bryce-b bryce-b enabled auto-merge (squash) September 8, 2025 15:23
@bryce-b bryce-b merged commit a70738b into open-telemetry:main Sep 8, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants