-
Notifications
You must be signed in to change notification settings - Fork 793
flask: fixed http_server_request_duration metrics being recorded for excluded urls #3794
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?
Conversation
...tion/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py
Outdated
Show resolved
Hide resolved
instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py
Outdated
Show resolved
Hide resolved
...tion/opentelemetry-instrumentation-flask/src/opentelemetry/instrumentation/flask/__init__.py
Outdated
Show resolved
Hide resolved
235f9d7
to
af2d12b
Compare
instrumentation/opentelemetry-instrumentation-flask/tests/test_programmatic.py
Outdated
Show resolved
Hide resolved
attr, | ||
_recommended_metrics_attrs_old[metric.name], | ||
) | ||
self.assertTrue(number_data_point_seen and histogram_data_point_seen) |
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.
histogram_data_point_seen should be false no?
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.
Yes, the histogram_data_point is false for the excluded_urls but true for the non-excluded urls.
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 it is confusing, I can simply remove this test as the test below this one test_flask_metrics_new_semconv_excluded_urls
, is doing pretty much the same thing but for all three URLs.
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 would suggest you keep both, but instead make them identical in terms of testing. For example: test_flask_metrics_excluded_urls and test_flask_metrics_excluded_urls_new_semconv (the suffix here is important). They should be the same test, but asserting different attributes from semconv.
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.
@emdneto Fixed the test names.
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.
@rads-1996 can you make both tests identical? either having the call to /hello/756
or not, or create a new test if you want a mix of excluded urls + allowed urls
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.
@emdneto I made the assertions in both the tests same. This tests only the excluded urls.
… metrics was being recorded for excluded urls.
Co-authored-by: Riccardo Magliocchetti <[email protected]>
c17adc7
to
e8d3cc0
Compare
Fixed an issue #2352 where
http_server_request_duration
metrics was being recorded for excluded urls.Description
Fixes #2352
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.