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

Support request and response hooks for Django instrumentation #407

Merged
merged 4 commits into from
Apr 8, 2021

Conversation

owais
Copy link
Contributor

@owais owais commented Apr 5, 2021

Description

Add request and response hooks support for Django instrumentation. This allows users to customize a bunch of things. Users can set custom span names, add additional attributes or other information to spans, inject tracing information into responses, etc.

Fixes #138

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?

  • Added unit test

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

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

@owais owais requested a review from a team as a code owner April 5, 2021 13:49
@owais owais requested review from lzchen and srikanthccv and removed request for a team April 5, 2021 13:49
@owais owais force-pushed the instrumentation-hooks branch 8 times, most recently from d4d466e to 27ace6d Compare April 5, 2021 14:36
@@ -11,6 +11,67 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Opportunistic update. Django was missing docs so copied from README.rst

@srikanthccv
Copy link
Member

We have couple of instrumentations where we let users set custom span name with name_callback. This change covers it along with many other things one can do. So we will be removing the span name callback?

@owais
Copy link
Contributor Author

owais commented Apr 5, 2021

I'd like to remove them at some point, yes, but not sure but much breakage it'll cause. Let's discuss that in the SIG meeting.

@lzchen
Copy link
Contributor

lzchen commented Apr 5, 2021

Fixes #138

Copy link
Member

@srikanthccv srikanthccv left a comment

Choose a reason for hiding this comment

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

LGTM

@owais owais changed the title Support request and resposne hooks for Django instrumentation Support request and response hooks for Django instrumentation Apr 5, 2021
@owais owais force-pushed the instrumentation-hooks branch 2 times, most recently from adc515d to 2e6c4d3 Compare April 5, 2021 18:21
@codeboten codeboten merged commit 1ee8924 into open-telemetry:main Apr 8, 2021
@owais owais deleted the instrumentation-hooks branch April 8, 2021 15:54
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.

Add hook to set custom span name in django instrumentation
4 participants