[Exporter] Update config manager to latest spec#47949
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Azure Monitor OpenTelemetry Exporter's OneSettings configuration manager to align with the latest spec. It replaces the previous CHANGE_VERSION-based change-detection mechanism with an ETag/If-None-Match conditional-request model: the CHANGE endpoint (e2) is polled with the cached ETag, and a 200 (new or absent ETag) triggers a CONFIG endpoint (e1) fetch, while 304 Not Modified skips it. It also demotes all OneSettings log statements from warning to debug to reduce noise for users behind firewalls. Since the config manager is still gated behind commented-out initialization in _base.py, this feature is not yet active at runtime.
Changes:
- Remove version tracking (
version,version_cache,_ONE_SETTINGS_CHANGE_VERSION_KEY,get_current_version) and switch change detection to ETag comparison. - Change OneSettings logging from
warningtodebugand drop the now-unnecessarydo-not-log-exceptions-if-not-debugpylint suppressions. - Update unit tests and CHANGELOG to reflect the new ETag-based flow.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
azure/.../_configuration/__init__.py |
Rewrites get_configuration_and_refresh_interval to ETag-based flow; removes version_cache and get_current_version. |
azure/.../_configuration/_utils.py |
Removes version from OneSettingsResponse and version parsing; logging moved to debug. |
azure/.../_configuration/_worker.py |
Refresh-loop failure logging moved to debug. |
azure/.../_constants.py |
Removes _ONE_SETTINGS_CHANGE_VERSION_KEY. |
azure/.../export/_base.py |
Comment-only reindentation of the (still commented-out) initialize call. |
azure/.../_utils.py |
Comment-only wording update (statsbeat→sdkstats). |
tests/configuration/test_manager.py |
Rewrites version-based tests to ETag-based; updates log-level assertions. |
tests/configuration/test_utils.py |
Drops version assertions and _ONE_SETTINGS_CHANGE_VERSION_KEY usage. |
tests/configuration/test_worker.py |
Updates assertion to check debug instead of warning. |
CHANGELOG.md |
Documents the ETag-based change detection and log-level change under Other Changes. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CHANGE_VERSIONand simply compares etag for change endpoint in onesettings