Add selective instrumentation configuration#501
Add selective instrumentation configuration#501sinsi404 wants to merge 1 commit intoopen-telemetry:mainfrom
Conversation
|
|
Support OTEL_LARAVEL_ENABLED_INSTRUMENTATIONS and OTEL_LARAVEL_DISABLED_INSTRUMENTATIONS environment variables to enable/disable specific instrumentations (http, console, queue, eloquent, cache, db, etc.)
732b96c to
1af7037
Compare
Please can you open a bug report for this? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #501 +/- ##
============================================
+ Coverage 82.54% 83.64% +1.09%
+ Complexity 2338 2198 -140
============================================
Files 159 136 -23
Lines 8823 8015 -808
============================================
- Hits 7283 6704 -579
+ Misses 1540 1311 -229 Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
| private const ENV_ENABLED = 'OTEL_LARAVEL_ENABLED_INSTRUMENTATIONS'; | ||
| private const ENV_DISABLED = 'OTEL_LARAVEL_DISABLED_INSTRUMENTATIONS'; |
There was a problem hiding this comment.
spec recommends that language-specific env vars should begin with OTEL_PHP
I've added a feature to selectively enable or disable Laravel auto-instrumentations via environment variables. This is required for me to disable db instrumentation as it has some weird bug. It will also help improve performance when the application doesn't require specific traces.
This selective instrumentation approach is inspired by auto-instrumentations-node
This is my first PR to this community, so please let me know if there's anything I should fix or improve.