-
Notifications
You must be signed in to change notification settings - Fork 631
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
Implement new HTTP semantic convention opt-in for Falcon #2790
base: main
Are you sure you want to change the base?
Implement new HTTP semantic convention opt-in for Falcon #2790
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.
A big thanks for working on this one. Just some comments
instrumentation/opentelemetry-instrumentation-falcon/tests/test_falcon.py
Outdated
Show resolved
Hide resolved
...on/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py
Outdated
Show resolved
Hide resolved
@FilipNikolovski |
Thanks for the feedback. I've updated the file, but that step is still failing 🤷. Not sure if I need to run |
You need to run it locally and commit the updated files so it will match on CI |
...on/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py
Outdated
Show resolved
Hide resolved
...on/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py
Outdated
Show resolved
Hide resolved
duration_attrs[SpanAttributes.HTTP_STATUS_CODE] = ( | ||
span.attributes.get(SpanAttributes.HTTP_STATUS_CODE) | ||
duration_s = default_timer() - start | ||
if self.duration_histogram_old: |
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.
Nit: I think you can use add_response_attributes instead to populate duration attributes with status.
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.
Not sure if we'll be able to use this one, since it returns early if span is not recording.
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.
Should be fixed with: https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3148/files
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've made the necessary updates.
…ndependent from tracing decisions; update tests
@xrmx running
|
That's weird, because |
Turns out I still had the sklearn directory 🤦, the command ran successfully after I deleted it. |
...on/opentelemetry-instrumentation-falcon/src/opentelemetry/instrumentation/falcon/__init__.py
Outdated
Show resolved
Hide resolved
CHANGELOG.md
Outdated
@@ -51,6 +51,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
([#2942](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2942)) | |||
- `opentelemetry-instrumentation-click`: new instrumentation to trace click commands | |||
([#2994](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/2994)) | |||
- `opentelemetry-instrumentation-falcon` Implement new HTTP semantic convention opt-in for Falcon |
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.
You have to move this to the unreleased section above
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.
Ah thanks, i've made the update.
…ry-python-contrib into falcon_new_semconv
…ki/opentelemetry-python-contrib into falcon_new_semconv
self.client().simulate_get("/hello/756") | ||
duration = max(round((default_timer() - start) * 1000), 0) |
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.
Maybe I missed something in the discussion, but why are you removing the duration itself check?
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, that probably got lost in the refactor of the tests, I can re-add that check.
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've re-added the checks.
SpanAttributes.HTTP_ROUTE: "/hello", | ||
} | ||
expected_attributes_new = { | ||
SpanAttributes.HTTP_REQUEST_METHOD: method, |
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.
In other instrumentations we are using the symbols from opentelemetry.semconv.attributes.http_attributes
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'll make the change.
Description
This change updates the falcon instrumentor to adhere to the new HTTP semantic conventions, according to the migration plan outlined here:
also fixes #1532
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Updated the tests to assert that the new span and duration attributes have been added.