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

Semantic conventions for Instrumentation Scope Attributes #2682

Open
joaopgrassi opened this issue Jul 21, 2022 · 4 comments
Open

Semantic conventions for Instrumentation Scope Attributes #2682

joaopgrassi opened this issue Jul 21, 2022 · 4 comments
Assignees
Labels
area:semantic-conventions Related to semantic conventions spec:miscellaneous For issues that don't match any other spec label triaged-accepted The issue is triaged and accepted by the OTel community, one can proceed with creating a PR proposal

Comments

@joaopgrassi
Copy link
Member

joaopgrassi commented Jul 21, 2022

What are you trying to achieve?

Scope attributes were introduced in #2579 with the motivations behind it described in this OTEP. A first motivation was to have an attribute to hold a instrumentation scope "short name"

What did you expect to see?

Clearly defined semantic conventions around scope attributes so instrumentation/back-ends can rely/do things with it in a consistent manner.

Additional context.

I did some experimentation with the build-tools and how we would auto-generate the conventions tables, the same way we do for the rest today. You can see my attempt in this diff: https://github.com/open-telemetry/opentelemetry-specification/compare/main...dynatrace-oss-contrib:opentelemetry-specification:feature/scope_attributes_semconv?expand=1

My idea behind it was:

  1. For scope attributes that are common across signals: A YAML file in semantic_conventions/common/scope.yaml generating a .md file in specification/common/scope.md.
  2. If there's need for signal-specific scope attributes: A YAML file in semantic_conventions/metrics/scope-metrics.yaml generating a .md file in specification/metrics/semantic_conventions/scope-metrics.md

Those would give us:

  • Common attributes: scope.* e.g. scope.short_name
  • Signal-specific attributes: scope_metrics.* e.g. scope_metrics.my_meter_attribute

cc @dashpole @tigrannajaryan

@joaopgrassi joaopgrassi added the spec:miscellaneous For issues that don't match any other spec label label Jul 21, 2022
@arminru arminru added the area:semantic-conventions Related to semantic conventions label Jul 21, 2022
@tigrannajaryan
Copy link
Member

This is part of the Scope initiative. Triaging as accepted.

@tigrannajaryan tigrannajaryan added the triaged-accepted The issue is triaged and accepted by the OTel community, one can proceed with creating a PR proposal label Jul 21, 2022
@tigrannajaryan
Copy link
Member

Important questions to answer:

  • Are Scope attributes considered a completely different namespace from the other attributes? I.e. can I have a Scope attribute http.host that has a completely different meaning from the Span attribute http.host?
  • Or, are Scope attributes in the same namespace as all other attributes? If they are in the same namespace which of the existing attributes are OK to record on the Scope? All attributes? Some?
  • What does it mean to record an attribute that is defined for a Span at the Scope? Does it mean it applies to all Spans (and is a form of compression) or it applies to the Scope only and the Span can have its own value recorded?

@dashpole
Copy link
Contributor

Are Scope attributes considered a completely different namespace from the other attributes? I.e. can I have a Scope attribute http.host that has a completely different meaning from the Span attribute http.host?

I think the answer should be yes (namespaces are different), although we should try and avoid unnecessary collisions where possible to reduce confusion. I believe this is the same answer as the separation between resource vs trace/metric/log attributes.

What does it mean to record an attribute that is defined for a Span at the Scope?

I'd prefer if it was exclusively something that describes the scope and not telemetry within the scope. It would make aggregation of telemetry more complex if it was considered equivalent for an attribute to either be present in the scope, or present in all telemetry within the scope.

If there's need for signal-specific scope attributes

I'd prefer starting without any signal-specific attributes. We can always add them later if we have need to introduce such a concept.

@joaopgrassi
Copy link
Member Author

The question of namespaces and scope attributes appearing in different places (resource, span) is highly relevant for #2535. I guess whatever we come up with here, needs to be at least considered on how it is mapped to non-otlp exporters.

tigrannajaryan pushed a commit that referenced this issue Aug 16, 2022
This unblocks #2702 by making the changes introduced in open-telemetry/build-tools#114 available for use.

It also allows for more semantic conventions for scope attributes to be defined in the future (#2682).

See https://github.com/open-telemetry/build-tools/releases/tag/v0.14.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:semantic-conventions Related to semantic conventions spec:miscellaneous For issues that don't match any other spec label triaged-accepted The issue is triaged and accepted by the OTel community, one can proceed with creating a PR proposal
Development

Successfully merging a pull request may close this issue.

5 participants