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

Clarify that Trace/Meter are associated with Instrumentation Scope #2276

Merged
merged 11 commits into from
Feb 15, 2022

Conversation

tigrannajaryan
Copy link
Member

@tigrannajaryan tigrannajaryan commented Jan 19, 2022

This is a slightly different take on #2203

Instead of renaming instrumentation library to instrumentation scope everywhere
this PR suggests targetted editing of wording of the Trace/Meter obtaining API
to allow not just instrumentation library but other instrumentation scopes to be
used as a parameter.

This change does not force renaming of API parameters and is not a breaking change.
We consider it a clarification of usage to match the intent that we had for the "name"
field.

If this PR is accepted there will be a follow up PR that will suggest to rename
InstrumentationLibrary* messages in OTLP proto to InstrumentationScope* message.
Such a change will not be a breaking change for the OTLP wire format and is acceptable.

If this PR is accepted we will also close #1236
since it will be no longer necessary. The logger name will be recorded as the
instrumentation scope, done in a separate PR that clarifies the behavior in https://github.com/open-telemetry/oteps/blob/main/text/logs/0150-logging-library-sdk.md

Resolves #2307

@tigrannajaryan tigrannajaryan requested review from a team January 19, 2022 22:36
@tigrannajaryan tigrannajaryan requested a review from a team January 19, 2022 22:39
@tigrannajaryan tigrannajaryan added the area:api Cross language API specification issue label Jan 19, 2022
yurishkuro
yurishkuro previously approved these changes Jan 20, 2022
specification/glossary.md Outdated Show resolved Hide resolved
@carlosalberto
Copy link
Contributor

Overall LGTM - I'd like to get the opinion of maintainers though.

cc @tedsuo

@tigrannajaryan
Copy link
Member Author

Let's keep this open for at least one week. I want to make sure lots of folks see this.

@tigrannajaryan
Copy link
Member Author

We should also mention this in the Maintainers and Spec SIG meetings next week.

@bogdandrutu
Copy link
Member

@tigrannajaryan I created an entry for the next week maintainer agenda meeting, and add this as a discussion point. I will not be there.

@tigrannajaryan
Copy link
Member Author

@open-telemetry/specs-approvers I won't be able to attend the Maintainers meeting today. If you are in the meeting please ask maintainers to have a look / be aware of this change.

specification/metrics/api.md Outdated Show resolved Hide resolved
specification/trace/api.md Outdated Show resolved Hide resolved
@arminru arminru added spec:metrics Related to the specification/metrics directory spec:trace Related to the specification/trace directory labels Jan 24, 2022
specification/metrics/api.md Outdated Show resolved Hide resolved
specification/trace/api.md Outdated Show resolved Hide resolved
@tigrannajaryan
Copy link
Member Author

@open-telemetry/specs-metrics-approvers @open-telemetry/specs-trace-approvers please review.

Copy link
Member

@dyladan dyladan left a comment

Choose a reason for hiding this comment

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

Expanding the definition of a field that was already declared stable such that it is now possible to lose the originally intended information contained in the field (by using a class name instead of the actual library name) breaks the field.

  • This is breaking for receivers who depend on the instrumentation library name being contained in this field, with no way to recover this information
  • Logger name will not always refer to the instrumentation library as this field was intended. Actually, it is extremely unlikely to refer to the instrumentation library and would rather refer to the thing being instrumented.

@tigrannajaryan
Copy link
Member Author

@dyladan to clarify, your position is that we should not make this change for Tracer/Meter name because it is a breaking change. You think that it is OK to assign a different meaning to the Logger name field, i.e. accept that it is not going to be consistent with Tracer/Meter name in its semantics.

tigrannajaryan added a commit to tigrannajaryan/opentelemetry-specification that referenced this pull request Feb 22, 2022
Contributes to open-telemetry#1215
Contributes to open-telemetry#2358

The topics has been discussed at length.

This [PR](open-telemetry#2276) made
possible to record instrumentation scope for traces and metrics. The intent is also to
have instrumentation scope part of log data model and where available record logger name
as the instrumentation scope name.
tigrannajaryan added a commit to tigrannajaryan/opentelemetry-specification that referenced this pull request Feb 22, 2022
Contributes to open-telemetry#1215
Contributes to open-telemetry#2358

The topics has been discussed at length.

This [PR](open-telemetry#2276) made
possible to record instrumentation scope for traces and metrics. The intent is also to
have instrumentation scope part of log data model and where available record logger name
as the instrumentation scope name.
tigrannajaryan added a commit that referenced this pull request Feb 24, 2022
Contributes to #1215
Contributes to #2358

The topics has been discussed at length.

This [PR](#2276) made
possible to record instrumentation scope for traces and metrics. The intent is also to
have instrumentation scope part of log data model and where available record logger name
as the instrumentation scope name.
tigrannajaryan added a commit to open-telemetry/opentelemetry-proto that referenced this pull request Mar 9, 2022
This applies changes described in spec PR open-telemetry/opentelemetry-specification#2276

This is not a breaking change for OTLP. The wire format does not change.

The change is done in a way that the transition can be handled gracefully for OTLP/JSON and for the generated code. See the comments for explanation on how to do it in the senders and receivers.
tsloughter pushed a commit to tsloughter/opentelemetry-erlang that referenced this pull request Jun 8, 2022
tsloughter pushed a commit to tsloughter/opentelemetry-erlang that referenced this pull request Jun 8, 2022
tsloughter pushed a commit to tsloughter/opentelemetry-erlang that referenced this pull request Jun 11, 2022
tigrannajaryan pushed a commit that referenced this pull request Jun 21, 2022
OTEL-PHP at some point switched to using InstrumentationScope instead of InstrumentationLibrary everywhere, which incidentally satisfied the ["Fetch InstrumentationScope from ReadableSpan"](https://github.com/open-telemetry/opentelemetry-specification/blob/9abbdd39d0b35f635f833f072013431da419894e/specification/common/mapping-to-non-otlp.md#instrumentationscope) part of the spec (otel-php is still alpha so it seemed ok to not deprecate the instrumentation library and just remove it's use entirely)

Related issues #
open-telemetry/opentelemetry-php#705

Related [OTEP(s)](https://github.com/open-telemetry/oteps) #
Don't think it was an OTEP but #2276 is where the push for the change originally came from I believe
ahayworth added a commit to ahayworth/opentelemetry-ruby that referenced this pull request Jul 14, 2022
This commit accomplishes two things simultaneously - adding support for
InstrumentationScope everywhere, and also updating the OTLP proto to v0.18.0.

The PR that introduced InstrumentationScope is [here](open-telemetry/opentelemetry-specification#2276)

My best understanding (which is implemented in this PR) is that:
- Our OTLP export requests should group by InstrumentationScope instead
  of InstrumentationLibrary
- We must be able to support accessing the InstrumentationLibrary from
  anywhere a ReadableSpan is available, and that it should represent the
  `name` and `version` fields from the InstrumentationScope.
- When creating a tracer, we create and store an InstrumentationScope
  rather than an InstrumentationLibrary.
- Non-OTLP exporters must export both `otlp.scope.{name,version}` AND
  `otlp.library.{name,version}` tags for backwards compatibility.

Some notes that may be interesting:
- I chose to keep the original definition of `InstrumentationLibrary`
  around for now.
- I chose to have `Span#instrumentation_library` and
  `SpanData#instrumentation_library` create and memoize an `InstrumentationLibrary`
  on-demand when someone asks for it (and marked the method as
  deprecated in the YARD docs).
- I chose *not* to reference that deprecated helper when modifying the
  zipkin and jaeger exporters, for performance reasons.
ahayworth added a commit to ahayworth/opentelemetry-ruby that referenced this pull request Jul 14, 2022
This commit accomplishes two things simultaneously - adding support for
InstrumentationScope everywhere, and also updating the OTLP proto to v0.18.0.

The PR that introduced InstrumentationScope is [here](open-telemetry/opentelemetry-specification#2276)

My best understanding (which is implemented in this PR) is that:
- Our OTLP export requests should group by InstrumentationScope instead
  of InstrumentationLibrary
- We must be able to support accessing the InstrumentationLibrary from
  anywhere a ReadableSpan is available, and that it should represent the
  `name` and `version` fields from the InstrumentationScope.
- When creating a tracer, we create and store an InstrumentationScope
  rather than an InstrumentationLibrary.
- Non-OTLP exporters must export both `otlp.scope.{name,version}` AND
  `otlp.library.{name,version}` tags for backwards compatibility.

Some notes that may be interesting:
- I chose to keep the original definition of `InstrumentationLibrary`
  around for now.
- I chose to have `Span#instrumentation_library` and
  `SpanData#instrumentation_library` create and memoize an `InstrumentationLibrary`
  on-demand when someone asks for it (and marked the method as
  deprecated in the YARD docs).
- I chose *not* to reference that deprecated helper when modifying the
  zipkin and jaeger exporters, for performance reasons.
robertlaurin pushed a commit to open-telemetry/opentelemetry-ruby that referenced this pull request Aug 22, 2022
…1345)

* feat: support InstrumentationScope, and update OTLP proto to 0.18.0

This commit accomplishes two things simultaneously - adding support for
InstrumentationScope everywhere, and also updating the OTLP proto to v0.18.0.

The PR that introduced InstrumentationScope is [here](open-telemetry/opentelemetry-specification#2276)

My best understanding (which is implemented in this PR) is that:
- Our OTLP export requests should group by InstrumentationScope instead
  of InstrumentationLibrary
- We must be able to support accessing the InstrumentationLibrary from
  anywhere a ReadableSpan is available, and that it should represent the
  `name` and `version` fields from the InstrumentationScope.
- When creating a tracer, we create and store an InstrumentationScope
  rather than an InstrumentationLibrary.
- Non-OTLP exporters must export both `otlp.scope.{name,version}` AND
  `otlp.library.{name,version}` tags for backwards compatibility.

Some notes that may be interesting:
- I chose to keep the original definition of `InstrumentationLibrary`
  around for now.
- I chose to have `Span#instrumentation_library` and
  `SpanData#instrumentation_library` create and memoize an `InstrumentationLibrary`
  on-demand when someone asks for it (and marked the method as
  deprecated in the YARD docs).
- I chose *not* to reference that deprecated helper when modifying the
  zipkin and jaeger exporters, for performance reasons.

* Update sdk/test/opentelemetry/sdk/trace/span_test.rb

Co-authored-by: Francis Bogsanyi <francis.bogsanyi@shopify.com>

* Update sdk/lib/opentelemetry/sdk/trace/span_data.rb

Co-authored-by: Francis Bogsanyi <francis.bogsanyi@shopify.com>

* Update sdk/lib/opentelemetry/sdk/trace/span.rb

Co-authored-by: Francis Bogsanyi <francis.bogsanyi@shopify.com>

* fixup: use alias_method

* fixup: add deprecation notice to InstrumentationLibrary

* fixup: argh, use alias in class scope

* Update sdk/lib/opentelemetry/sdk/trace/span.rb

Co-authored-by: Francis Bogsanyi <francis.bogsanyi@shopify.com>

* Update sdk/lib/opentelemetry/sdk/trace/span.rb

Co-authored-by: Francis Bogsanyi <francis.bogsanyi@shopify.com>

* Update sdk/lib/opentelemetry/sdk/trace/span_data.rb

Co-authored-by: Francis Bogsanyi <francis.bogsanyi@shopify.com>

* fixup: update Rakefile to regenerate protos correctly

It now checks out a specific tag, for starters.

* bundle exec rake update_protobuf

Co-authored-by: Francis Bogsanyi <francis.bogsanyi@shopify.com>
beeme1mr pushed a commit to beeme1mr/opentelemetry-specification that referenced this pull request Aug 31, 2022
…metry#2622)

OTEL-PHP at some point switched to using InstrumentationScope instead of InstrumentationLibrary everywhere, which incidentally satisfied the ["Fetch InstrumentationScope from ReadableSpan"](https://github.com/open-telemetry/opentelemetry-specification/blob/9abbdd39d0b35f635f833f072013431da419894e/specification/common/mapping-to-non-otlp.md#instrumentationscope) part of the spec (otel-php is still alpha so it seemed ok to not deprecate the instrumentation library and just remove it's use entirely)

Related issues #
open-telemetry/opentelemetry-php#705

Related [OTEP(s)](https://github.com/open-telemetry/oteps) #
Don't think it was an OTEP but open-telemetry#2276 is where the push for the change originally came from I believe
ChengJinbao added a commit to ChengJinbao/opentelemetry-specification that referenced this pull request Nov 16, 2022
Contributes to open-telemetry/opentelemetry-specification#1215
Contributes to open-telemetry/opentelemetry-specification#2358

The topics has been discussed at length.

This [PR](open-telemetry/opentelemetry-specification#2276) made
possible to record instrumentation scope for traces and metrics. The intent is also to
have instrumentation scope part of log data model and where available record logger name
as the instrumentation scope name.
ChengJinbao added a commit to ChengJinbao/opentelemetry-specification that referenced this pull request Nov 16, 2022
OTEL-PHP at some point switched to using InstrumentationScope instead of InstrumentationLibrary everywhere, which incidentally satisfied the ["Fetch InstrumentationScope from ReadableSpan"](https://github.com/open-telemetry/opentelemetry-specification/blob/65624332cadac9990923f442e96a424c308e502c/specification/common/mapping-to-non-otlp.md#instrumentationscope) part of the spec (otel-php is still alpha so it seemed ok to not deprecate the instrumentation library and just remove it's use entirely)

Related issues #
open-telemetry/opentelemetry-php#705

Related [OTEP(s)](https://github.com/open-telemetry/oteps) #
Don't think it was an OTEP but open-telemetry/opentelemetry-specification#2276 is where the push for the change originally came from I believe
joaopgrassi pushed a commit to dynatrace-oss-contrib/semantic-conventions that referenced this pull request Mar 21, 2024
Contributes to open-telemetry/opentelemetry-specification#1215
Contributes to open-telemetry/opentelemetry-specification#2358

The topics has been discussed at length.

This [PR](open-telemetry/opentelemetry-specification#2276) made
possible to record instrumentation scope for traces and metrics. The intent is also to
have instrumentation scope part of log data model and where available record logger name
as the instrumentation scope name.
joaopgrassi pushed a commit to dynatrace-oss-contrib/semantic-conventions that referenced this pull request Mar 21, 2024
OTEL-PHP at some point switched to using InstrumentationScope instead of InstrumentationLibrary everywhere, which incidentally satisfied the ["Fetch InstrumentationScope from ReadableSpan"](https://github.com/open-telemetry/opentelemetry-specification/blob/9abbdd39d0b35f635f833f072013431da419894e/specification/common/mapping-to-non-otlp.md#instrumentationscope) part of the spec (otel-php is still alpha so it seemed ok to not deprecate the instrumentation library and just remove it's use entirely)

Related issues #
open-telemetry/opentelemetry-php#705

Related [OTEP(s)](https://github.com/open-telemetry/oteps) #
Don't think it was an OTEP but open-telemetry/opentelemetry-specification#2276 is where the push for the change originally came from I believe
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
…pen-telemetry#2276)

* Clarify that Trace/Meter are associated with Instrumentation Scope

This is a slightly different take on open-telemetry#2203

Instead of renaming instrumentation library to instrumentation scope everywhere
this PR suggests targetted editing of wording of the Trace/Meter obtaining API
to allow not just instrumentation library but other instrumentation scopes to be
used as a parameter.

This change does not force renaming of API parameters and is not a breaking change.
We consider it a clarification of usage to match the intent that we had for the "name"
field.

If this PR is accepted there will be a follow up PR that will suggest to rename
InstrumentationLibrary* messages in OTLP proto to InstrumentationScope* message.
Such a change will not be a breaking change for the OTLP wire format and is acceptable.

If this PR is accepted we will also close open-telemetry#1236
since it will be no longer necessary. The logger name will be recorded as the
instrumentation scope. This clarification will be a follow up PR that clarifies the
behavior in https://github.com/open-telemetry/oteps/blob/main/text/logs/0150-logging-library-sdk.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:api Cross language API specification issue spec:metrics Related to the specification/metrics directory spec:trace Related to the specification/trace directory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ideas on how to InstrumentationLibrary -> Scope