-
Notifications
You must be signed in to change notification settings - Fork 3k
Add diagnostics for AKS #40988
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
Add diagnostics for AKS #40988
Conversation
API change check API changes are not detected in this pull request. |
9c922d6
to
0bc0f56
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request updates diagnostic functionality to support both App Service and AKS attach scenarios while removing legacy diagnostics for manual instrumentation. Key changes include:
- Replacing the constant _IS_DIAGNOSTICS_ENABLED with the new function _is_diagnostics_enabled() in multiple modules.
- Updating unit tests across utilities and diagnostics modules to patch the new diagnostics function and support the AKS attach scenario.
- Updating the CHANGELOG to reflect the new diagnostics enabled for AKS attach.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
sdk/monitor/azure-monitor-opentelemetry/tests/utils/test_utils.py | Updated tests to validate diagnostics enablement using patch decorators for App Service, AKS, and Functions attach scenarios. |
sdk/monitor/azure-monitor-opentelemetry/tests/diagnostics/test_status_logger.py | Adjusted patch target from the old constant to the new _is_diagnostics_enabled() function. |
sdk/monitor/azure-monitor-opentelemetry/tests/diagnostics/test_diagnostic_logging.py | Same as above—updated patch to target _is_diagnostics_enabled(). |
sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_utils/init.py | Imported and defined the new _is_diagnostics_enabled() function to reflect diagnostic enablement logic. |
sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_diagnostics/status_logger.py | Updated conditional check to call _is_diagnostics_enabled() instead of using the constant. |
sdk/monitor/azure-monitor-opentelemetry/azure/monitor/opentelemetry/_diagnostics/diagnostic_logging.py | Updated patch target from the constant to the _is_diagnostics_enabled() function. |
sdk/monitor/azure-monitor-opentelemetry/CHANGELOG.md | Documented new diagnostics behavior for AKS attach. |
Comments suppressed due to low confidence (1)
sdk/monitor/azure-monitor-opentelemetry/tests/utils/test_utils.py:65
- [nitpick] The order of patch decorator parameters may not match the typical decorator application order (which is bottom-to-top), potentially leading to confusion about which mock corresponds to which patched target. Consider reordering the mock parameters or adding inline comments to clarify the mapping.
def test_diagnostics_app_service_attach(self, attach_mock, app_service_mock, aks_mock, functions_mock):
Description
Diagnostics will now be enabled specifically for App Service attach and AKS attach. Also removes diagnostics for App Service manual instrumentation. However, those would not be triggered anyways.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines