Added custom log record processors configuration option#43713
Added custom log record processors configuration option#43713rads-1996 wants to merge 9 commits intoAzure:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for custom log record processors in the Azure Monitor OpenTelemetry distro. Users can now pass a list of LogRecordProcessor objects via the log_record_processors parameter to configure_azure_monitor(), allowing for custom processing and enrichment of log records before they are exported to Azure Monitor.
Key Changes
- Added
log_record_processorsparameter toconfigure_azure_monitor()configuration - Custom log record processors are now added to the logger provider before built-in processors (quickpulse and performance counters)
- Included a sample demonstrating how to use the feature to enrich logs with operation name from the current span context
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| azure/monitor/opentelemetry/_constants.py | Adds the LOG_RECORD_PROCESSORS_ARG constant for the new configuration parameter |
| azure/monitor/opentelemetry/_configure.py | Implements log record processor registration logic and adds parameter documentation |
| azure/monitor/opentelemetry/_utils/configurations.py | Adds default configuration handler for log record processors |
| samples/logging/modify_logs.py | Provides a working example of using custom log record processors |
| tests/test_configure.py | Updates tests to verify custom log record processors are registered correctly |
| tests/utils/test_configurations.py | Tests configuration handling for log record processors |
| README.md | Documents the new log_record_processors parameter in the configuration table |
| CHANGELOG.md | Adds release note for the new feature |
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…_logs.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Hi @rads-1996. Thank you for your interest in helping to improve the Azure SDK experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days. |
|
Superseeded by #44367 |
|
Hi @rads-1996. Thank you for your contribution. Since there hasn't been recent engagement, we're going to close this out. Feel free to respond with a comment containing |
All SDK Contribution checklist:
General Guidelines and Best Practices