Skip to content
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

Bugfix django instrumentation #1309

Merged
merged 6 commits into from
Nov 2, 2020
Merged

Bugfix django instrumentation #1309

merged 6 commits into from
Nov 2, 2020

Conversation

zzhutianyu
Copy link
Contributor

@zzhutianyu zzhutianyu commented Oct 30, 2020

Description

Fix: Django instrumentation if request have query_string will not correct resolver we need use request.path to replace request.get_full_path()

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

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

  • Test have query string and not have query string to get correct span name

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

…rect resolver we need use request.path to replace request.get_full_path()
@zzhutianyu zzhutianyu requested review from a team, toumorokoshi and hectorhdzg and removed request for a team October 30, 2020 10:10
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 30, 2020

CLA Check
The committers are authorized under a signed CLA.

@owais
Copy link
Contributor

owais commented Oct 30, 2020

Does this change strip off the query string from span name?

@zzhutianyu
Copy link
Contributor Author

no no no if request have query_string. The django resolve not match route so span name only "HTTP {http_method}", we want span name is django view_name or func_name or route

Copy link
Member

@toumorokoshi toumorokoshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Can you please add a change to the changelog? The this is good to go!

@@ -3,6 +3,7 @@
## Unreleased

- Django instrumentation is now enabled by default but can be disabled by setting `OTEL_PYTHON_DJANGO_INSTRUMENT` to `False` ([#1239](https://github.com/open-telemetry/opentelemetry-python/pull/1239))
- Bugfix use request.path replace request.get_full_path(). It will get correct span name ([#1309](https://github.com/open-telemetry/opentelemetry-python/pull/1309#))
Copy link
Member

@toumorokoshi toumorokoshi Oct 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typically with changelogs, you should try to have information that's relevant to the user, so mainly behavior. The details aren't really helpful to most.

In this case, it's sufficient to say "span name resolves correctly for paths that also require a query parameter to match".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your suggestion, I will pay attention to it later

Copy link
Member

@toumorokoshi toumorokoshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks!

srikanthccv pushed a commit to srikanthccv/opentelemetry-python that referenced this pull request Nov 1, 2020
* Basic node

* Tests and functions

* DefaultURL

* Add JSON tests

* Test rename

* Refactor a lot

* Restored those files

* Variable anme

* Fixed strings

* default grpc, collector name'
Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@codeboten codeboten merged commit a3a75e3 into open-telemetry:master Nov 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants