-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Remove skipping span creation by checking parent spans #2953
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
Comments
The current behavior is useful when you only instrument certain routes/operations and don't care about dangling/orphan redis calls. It is hard to achieve it otherwise. Can we make this configurable? AFAIR some instrumentations provide an option like |
Users can use their sampler to allow/disallow orphan spans. For instance, they can use So, I am not sure go-redis/extra/redisotel/tracing.go Lines 94 to 96 in f3fe611
BTW, using the
|
My suggestion is to remove this kind of code, and mention the go-redis/extra/redisotel/tracing.go Lines 94 to 96 in f3fe611
|
I was not aware about Then yes, let's document it and remove the code you've mentioned. |
Current Behavior
The
redisotel
skips the span creation by only checking theIsRecording
of the parent span. This breaks the span creation defined by opentelemetry specification.Considering a user configures an always-on sampler for debugging and expects every operation taken by Redis that has instrumentation. With the current implementation, this would drop spans even if the user wants to see it.
https://github.com/open-telemetry/opentelemetry-go/blob/ba5d1268082fcc4ccb8fa967eb5133fa23e4f2ba/sdk/trace/sampling.go#L128-L130
Possible Solution
Remove codes like this before calling
tracer.Start
go-redis/extra/redisotel/tracing.go
Lines 94 to 96 in f3fe611
More context
My concern only comes from OTel's perspective; let me know if it is a special case for go-redis. I am also happy to raise a PR to solve this issue.
The text was updated successfully, but these errors were encountered: