Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop strategy for generating semantic conventions in different signals, different domains #5

Closed
jack-berg opened this issue Aug 11, 2023 · 2 comments

Comments

@jack-berg
Copy link
Member

We currently put all semantic convention resource attributes in io.opentelemetry.semconv.resource.attributes.ResourceAttributes, and all others in io.opentelemetry.semconv.trace.attributes.SemanticAttributes.

There are several shortcomings with this strategy:

  • The *.trace.* portion of the package is a misnomer, since SemanticAttributes contains attributes for all signals
  • There are going to be semantic convention domains at varying levels of stability (i.e. http is looking to go stable in the fall but the others are still experimental), and even within a single domain different attributes may be at different levels of severity
  • The names of metrics are part of the semantic conventions and don't appear anywhere in the generated code
@jack-berg
Copy link
Member Author

Proposal from 12/07/23 Java SIG and @lmolkova 's prototype #40:

  • Stop differentiating between ResourceAttributes and SemanticAttributes. Attributes are attributes regardless of whether they're used on a resource, log, trace, metric, etc.
  • Break out attributes into classes named after the top level namespace. I.e. UserAgentAttributes for all attributes nested under user_agent.*. The hope is that this strikes a nice balance and avoids cumbersome mega-classes.
  • Break out attributes from anything else generated from conventions. I.e. if we generate constants for metric names (or functions for constructing instruments), put those in separate classes from the attributes for that namespace. For example, for http.* attributes / metrics we would have HttpAttributes and HttpMetrics.

@jack-berg
Copy link
Member Author

Fixed in #45.

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

No branches or pull requests

1 participant