-
Notifications
You must be signed in to change notification settings - Fork 626
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
Request/Response hooks for Tornado server and client #426
Conversation
@@ -24,7 +24,7 @@ | |||
from opentelemetry.instrumentation.tornado import TornadoInstrumentor | |||
|
|||
# apply tornado instrumentation | |||
TornadoInstrumentor().instrument() | |||
# TornadoInstrumentor().instrument() |
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.
Do we need this to be commented?
.../opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py
Show resolved
Hide resolved
.../opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py
Show resolved
Hide resolved
@@ -65,15 +65,21 @@ def fetch_async(tracer, func, _, args, kwargs): | |||
span.set_attribute(key, value) | |||
|
|||
with trace.use_span(span): | |||
if request_hook: |
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.
Any difference between calling request_hook
within the use_span
vs outside?
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.
Should be called right after the span is created right?
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.
No difference really. I'll move it out to avoid any future confusion.
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.
PR looks good @owais, just one question about the rst
file and please address leighton's comments
@@ -0,0 +1,7 @@ | |||
OpenTelemetry Tornado Instrumentation |
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 the right place for this doc? i'm confused about the tornado/starlette/tornado.rst
path.
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.
Sorry about that. No idea how that happened. My guess is an unintentional drag in vscode sidebar :)
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.
Thanks for addressing my comment!
@owais please address the conflicts so we can get this merged |
@codeboten updated. |
Description
Adds support for request and response hooks to Falcon instrumentation. Given how tornado works, we only have a single hook that gets called once per request. It gets passed the active handler instead of request/response objects.
Fixes #132
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.