-
Notifications
You must be signed in to change notification settings - Fork 192
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
fix: Untrace entire request #968
fix: Untrace entire request #968
Conversation
c044a32
to
e7f2e48
Compare
e7f2e48
to
fe56a27
Compare
return if untraced_request?(request.env) | ||
if untraced_request?(request.env) | ||
ctx = OpenTelemetry::Common::Utilities.untraced | ||
request.env[UNTRACED_CTX_TOKEN] = OpenTelemetry::Context.attach(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need another context (attached) and another token for this? We should add a context = OpenTelemetry::Context.current
parameter to extract_remote_context
and pass in the untraced context if necessary. I.e.:
parent_context = if untraced_request?(request.env)
extract_remote_context(request, OpenTelemetry::Common::Utilities.untraced)
else
extract_remote_context(request)
end
a455e1c
to
d4fd8d5
Compare
d4fd8d5
to
0d332ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@@ -52,9 +52,12 @@ class EventHandler | |||
# @param [Rack::Response] This is nil in practice | |||
# @return [void] | |||
def on_start(request, _) | |||
return if untraced_request?(request.env) | |||
parent_context = if untraced_request?(request.env) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this relying on start_span to look for the untraced context as opposed to seething the current context to untraced without an active span?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's seeing that it's parent context is untraced so it will create a non recording span, and we have a lot of recording?
checks in this instrumentation as is so it seemed like a simpler implementation than what I had in this commit a8548ef
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood. Thanks again for fixing this!
Bumping all the common deps here c8144bc |
Depends on common 0.21.0 for open-telemetry/opentelemetry-ruby#1634
closes: #962