-
Notifications
You must be signed in to change notification settings - Fork 607
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
send http.route attribute in flask metric #2506
send http.route attribute in flask metric #2506
Conversation
|
@GonzaloGuasch please sign the CLA |
@GonzaloGuasch please do all your commits from the same email that signed the CLA, see #2506 (comment) |
Changing the PR to draft until i resolve CLA certification with mi company! |
@@ -47,6 +47,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
|
|||
### Added | |||
|
|||
- `opentelemetry-instrumentation-flask` Add http route to metric attributes | |||
([#2506](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2506)) | |||
- |
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.
- |
duration_histogram_old.record( | ||
max(round(duration_s * 1000), 0), duration_attrs_old | ||
) | ||
if duration_histogram_new: | ||
duration_attrs_new = otel_wsgi._parse_duration_attrs( | ||
attributes, _HTTPStabilityMode.HTTP | ||
) | ||
|
||
if wrapped_app_environ.get(_ENVIRON_REQUEST_ROUTE_KEY, None): | ||
duration_attrs_new[SpanAttributes.HTTP_ROUTE] = wrapped_app_environ.get(_ENVIRON_REQUEST_ROUTE_KEY) |
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.
Shouldn't we use the new semconv attribute here?
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.
What do you mean by new semconv? To change the variable?
It is mandatory to have the key value "http.route"
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.
Please fix lint
…zaloGuasch/opentelemetry-python-contrib into feature/flask-attr-in-metric
…zaloGuasch/opentelemetry-python-contrib into feature/flask-attr-in-metric
…zaloGuasch/opentelemetry-python-contrib into feature/flask-attr-in-metric
@GonzaloGuasch the CLA check is failing 😓 |
Closing this PR due to contract problems 😭. Continue in this new #PR |
Description
Taking up this closed PR, when sending metrics in the Flask instrumentation, the http.route attribute is added to them.
This attribute is super important in the use of metrics and will greatly improve the experience of using Flask. This change was tested locally.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
running: tox -e test-instrumentation-flask
Does This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.