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

apmotel compile error with newer version of otel libraries #1603

Closed
kruskall opened this issue Apr 9, 2024 · 1 comment · Fixed by #1605
Closed

apmotel compile error with newer version of otel libraries #1603

kruskall opened this issue Apr 9, 2024 · 1 comment · Fixed by #1605
Labels

Comments

@kruskall
Copy link
Member

kruskall commented Apr 9, 2024

Describe the bug

Projects using both apmotel and otel libraries won't be able to update the otel libraries because of a compile error with apmotel.

Example failure:

elastic/apm-server#12924

 Error: ../../../go/pkg/mod/go.elastic.co/apm/module/apmotel/[email protected]/tracer.go:67:19: impossible type assertion: trace.SpanFromContext(ctx).(*span)
	*span does not implement trace.Span (missing method AddLink)
Error: ../../../go/pkg/mod/go.elastic.co/apm/module/apmotel/[email protected]/tracer.go:96:38: cannot use s (variable of type *span) as trace.Span value in argument to trace.ContextWithSpan: *span does not implement trace.Span (missing method AddLink)
Error: ../../../go/pkg/mod/go.elastic.co/apm/module/apmotel/[email protected]/tracer.go:96:42: cannot use s (variable of type *span) as trace.Span value in return statement: *span does not implement trace.Span (missing method AddLink)
Error: ../../../go/pkg/mod/go.elastic.co/apm/module/apmotel/[email protected]/tracer.go:116:36: cannot use s (variable of type *span) as trace.Span value in argument to trace.ContextWithSpan: *span does not implement trace.Span (missing method AddLink)
Error: ../../../go/pkg/mod/go.elastic.co/apm/module/apmotel/[email protected]/tracer.go:116:40: cannot use s (variable of type *span) as trace.Span value in return statement: *span does not implement trace.Span (missing method AddLink)
Error: ../../../go/pkg/mod/go.elastic.co/apm/module/apmotel/[email protected]/wrapper.go:53:36: cannot use &span{…} (value of type *span) as trace.Span value in argument to trace.ContextWithSpan: *span does not implement trace.Span (missing method AddLink)
Error: ../../../go/pkg/mod/go.elastic.co/apm/module/apmotel/[email protected]/wrapper.go:73:36: cannot use &span{…} (value of type *span) as trace.Span value in argument to trace.ContextWithSpan: *span does not implement trace.Span (missing method AddLink) (compile)

To Reproduce
Steps to reproduce the behavior:

  1. create a project
  2. use apmotel and otel libs 1.21+
  3. run any go command (test, build, etc.)
  4. See error

Expected behavior
No error

@dmathieu
Copy link
Member

dmathieu commented Apr 9, 2024

We need to add a (noop because we don't handle links) AddLink method to spans.
open-telemetry/opentelemetry-go#5032

@kruskall kruskall changed the title apmotel compile error with newer version of otel lirbaries apmotel compile error with newer version of otel libraries Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants