-
Notifications
You must be signed in to change notification settings - Fork 653
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
Added Falcon 2.0+ instrumentation #1039
Added Falcon 2.0+ instrumentation #1039
Conversation
1ad6ea6
to
dca4987
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.
This PR looks pretty good, just a couple of things that need to be fixed.
opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py
Show resolved
Hide resolved
opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap.py
Show resolved
Hide resolved
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.
👍
@open-telemetry/python-approvers would appreciate if someone could help review this. |
47fc481
to
7e84041
Compare
entry_points={ | ||
"opentelemetry_instrumentor": [ | ||
"falcon = opentelemetry.instrumentation.falcon:FalconInstrumentor" | ||
] | ||
}, |
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.
This can be moved to setup.cfg
.
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.
Moved.
try: | ||
return super().__call__(env, _start_response) | ||
except Exception as exc: | ||
activation.__exit__( |
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.
I am assuming that line 132 ends up calling _start_response
. What if an exception is raised during the execution of start_response
inside _start_response
? Would that exception be caught here and activation.__exit__
end up being called twice?
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.
Good catch. Fixed to call exit after start_response finishes.
FalconInstrumentor().uninstrument() | ||
|
||
def test_methods(self): | ||
for method in ["GET", "POST", "PATCH", "PUT", "DELETE", "HEAD"]: |
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.
Just as a comment, it can be worthy to have this separated in a test_X
method for every method, so that if one of these tests fail, it gets reported in the results which method failed.
358d78c
to
511c0d6
Compare
511c0d6
to
678f27e
Compare
Remove unwanted support for Python versions <3.6. This integration mistakenly lists Python 3.4 support, because it was merged in open-telemetry/opentelemetry-python#1039, after the merge of open-telemetry/opentelemetry-python#1099, so the latter didn't consider `falcon`. Python 3.4 is broken nevertheless, as this integration already includes f-strings and other `opentelemetry` dependencies, which require Python 3.6. Fixes open-telemetry#772.
Remove unwanted support for Python versions <3.6. This integration mistakenly lists Python 3.4 support, because it was merged in open-telemetry/opentelemetry-python#1039, after the merge of open-telemetry/opentelemetry-python#1099, so the latter didn't consider `falcon`. Python 3.4 is broken nevertheless, as this integration already includes f-strings and other `opentelemetry` dependencies, which require Python 3.6. Fixes open-telemetry#772.
Remove unwanted support for Python versions <3.6. This integration mistakenly lists Python 3.4 support, because it was merged in open-telemetry/opentelemetry-python#1039, after the merge of open-telemetry/opentelemetry-python#1099, so the latter didn't consider `falcon`. Python 3.4 is broken nevertheless, as this integration already includes f-strings and other `opentelemetry` dependencies, which require Python 3.6. Fixes #772.
Add instrumentation for Falcon 2.0+
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
Checklist: