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

Use noop instead of embedded for auto/sdk default implementations #1228

Closed
Tracked by #1229
MrAlias opened this issue Oct 29, 2024 · 0 comments · Fixed by #1230
Closed
Tracked by #1229

Use noop instead of embedded for auto/sdk default implementations #1228

MrAlias opened this issue Oct 29, 2024 · 0 comments · Fixed by #1230
Assignees
Milestone

Comments

@MrAlias
Copy link
Contributor

MrAlias commented Oct 29, 2024

type tracerProvider struct{ embedded.TracerProvider }

type tracer struct {
embedded.Tracer
name, schemaURL, version string
}

type span struct {
embedded.Span
sampled bool
spanContext trace.SpanContext
traces *telemetry.Traces
span *telemetry.Span
}

The embedded package will cause compilation errors when the implementation of the Go Trace API is not satisfied by an implementation.

Currently this is not an issue because the sdk package fully implements the Trace API. However if ...

  1. A new method is added to the Trace API
  2. All implementations of the Trace API need to be updated inopentelemetry-go (SDK and global)
  3. The global package depends on the auto/sdk implementation, therefore ...
  4. The auto/sdk needs to add the missing methods so the global package can compile
  5. A new release of the auto/sdk needs to be published
  6. The opentelemetry-go global API needs to update their dependency of auto/sdk to the one just release
  7. The opentelemetry-go project can make a release with the new Trace API changes

This circular update path can be avoided if the auto/sdk package embeds the noop implementation of the Trace API. The global package can be updated without a new version from auto/sdk needed as the default behavior will be that it compiles and acts as a NoOp. When we are able to develop an implementation of the added method that can be brought into the global API afterwards.

@MrAlias MrAlias added this to the v0.17.0-alpha milestone Oct 29, 2024
@MrAlias MrAlias self-assigned this Oct 29, 2024
MrAlias added a commit to MrAlias/opentelemetry-go-instrumentation that referenced this issue Oct 29, 2024
Default to NoOp behavior when the `sdk` pkg does not implement a method
of the Go OTel API instead of causing a compilation error.

Resolve open-telemetry#1228
@MrAlias MrAlias moved this from Todo to In Progress in Go Auto Instrumentation: Beta Oct 29, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Go Auto Instrumentation: Beta Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

1 participant