-
Notifications
You must be signed in to change notification settings - Fork 623
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
ext/requests - apply custom attributes callback #656
ext/requests - apply custom attributes callback #656
Conversation
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! The code looks good, just want to discuss the naming of the argument and make sure it's succinct.
ext/opentelemetry-ext-requests/src/opentelemetry/ext/requests/__init__.py
Outdated
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.
LGTM, some minor comments.
I second @toumorokoshi about the callback name, it could be more generic. Approving now assuming you'll handle it :)
ext/opentelemetry-ext-requests/tests/test_requests_integration.py
Outdated
Show resolved
Hide resolved
ext/opentelemetry-ext-requests/tests/test_requests_integration.py
Outdated
Show resolved
Hide resolved
ext/opentelemetry-ext-requests/tests/test_requests_integration.py
Outdated
Show resolved
Hide resolved
ext/opentelemetry-ext-requests/src/opentelemetry/ext/requests/__init__.py
Show resolved
Hide resolved
ext/opentelemetry-ext-requests/tests/test_requests_integration.py
Outdated
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.
Great, thanks!
Implement passing an optional span_callback callback when instrumenting requests. The callback will be called just before returning the result and will be invoked with the span and the result (type of requests.Response). This mimics the same functionality as the js http plugin.
This PR implements passing an optional
span_callback
callback when instrumentingrequests
.The callback will be called just before returning the result and will be invoked with the
span
and theresult
(type of requests.Response).This mimics the same functionality as in js http plugin.
Example:
Please LMK if and what docs need to be updated.