-
Notifications
You must be signed in to change notification settings - Fork 837
HTTP semantic convention stability migration for Tornado #3993
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
base: main
Are you sure you want to change the base?
HTTP semantic convention stability migration for Tornado #3993
Conversation
|
Looks good to me! |
.../opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py
Outdated
Show resolved
Hide resolved
.../opentelemetry-instrumentation-tornado/src/opentelemetry/instrumentation/tornado/__init__.py
Outdated
Show resolved
Hide resolved
…telemetry/instrumentation/tornado/__init__.py Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
…telemetry/instrumentation/tornado/__init__.py Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
| Note that the patch does not apply on every single __init__ call, only the first one for the entire | ||
| process lifetime. | ||
| """ | ||
| global _sem_conv_opt_in_mode # pylint: disable=global-statement |
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 you think we can make this an attribute of TornadoInstrumentor instead of being global?
| if handler.request.path: | ||
| # Parse query from path if present | ||
| path = handler.request.path | ||
| if "?" in 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.
I'd use urllib.parse.urlparse instead of doing things manually
| HTTP_TARGET: request.path, | ||
| } | ||
| # Add target (path) for active requests | ||
| if request.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.
Are there cases where this is falsy?
| return | ||
| start_time = otel_handler_state.get(_START_TIME, None) or default_timer() | ||
| elapsed_time = round((default_timer() - start_time) * 1000) | ||
| elapsed_time_ms = round((default_timer() - start_time) * 1000) |
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.
If you calculate the elapsed_time_s first we can reuse that and then have the same value :)
Description
Adds HTTP semantic convention stability migration / opt-in for
opentelemetry-instrumentation-tornadoRemoves
reason,description, andStatusbecause opt-in util_set_statusdoesn't accept them. Changes the signatures of several helpers not used by other instrumentors:_create_client_histograms,_create_server_histograms,_get_attributes_from_request.Fixes #3991
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
Default span attributes
httpspan attributeshttp/duphas both sets.Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.