-
Notifications
You must be signed in to change notification settings - Fork 455
feat(django): avoid creating django database spans when the cursor is already wrapped #14312
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
Conversation
|
Bootstrap import analysisComparison of import times between this PR and base. SummaryThe average import time from this PR is: 271 ± 3 ms. The average import time from base is: 272 ± 5 ms. The import time difference between this PR and base is: -1.5 ± 0.2 ms. Import time breakdownThe following import paths have shrunk:
|
Performance SLOsCandidate: LANGPLAT-642/django.db.double.wrapped (ac53c5c) 🔵 No Baseline Data (24 suites)🔵 coreapiscenario - 12/12 (2 unstable)🔵 No baseline data available for this suite
|
Enable users to override the origin of the url to allow users to send the data to a different local endpoint than APM.
Today we always wrap Django ORM cursors with a span, regardless of whether the underlying database engine is already wrapped.
This means, if you are using a supported database engine, you will always get 2 spans for every database call.
The only major difference between these spans is the Django db span uses the Django database alias as the service override, and has
django.db.alias
anddjango.db.vendor
tags, and the PostgreSQL span has a few extra PostgreSQL specific tags likedb.application
anddb.system
With this change, we remove the extra span, but we merge the django specific tags onto the PostgreSQL span.
This change introduces a
DD_DJANGO_ALWAYS_CREATE_DATABASE_SPANS
setting to control this behavior for now, but this behavior should become the default/only option.With these extra spans disabled we reduce the overhead of tracing Django by about 6-7%, at least for our django_simple benchmark scenario.
Checklist
Reviewer Checklist