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
fix(remoteconfig): fix remoteconfig when flare data in payload [backport 2.8] #9203
Conversation
Datadog ReportBranch report: ✅ 0 Failed, 152891 Passed, 19504 Skipped, 10h 47m 19.53s Total duration (1h 55m 27.93s time saved) |
Remote config was broken entirely due to the addition of tracer flare data in the config sent from the agent. Example incoming RC config: ``` data = {'metadata': [{'id': 'configuration_order', 'product_name': 'AGENT_CONFIG', 'sha256_hash': 'ddfc2c7b5ee1710aa915edfccd8a0d452784d946cebae0554485b5c0539a9e2c', 'length': 198, 'tuf_version': 2, 'apply_state': 2, 'apply_error': None}, {'id': 'f6c80fdcc00b702c54ff6ae5ff2ac7f16d9afef109bdf53ee990376455301ab2', 'product_name': 'APM_TRACING', 'sha256_hash': '098cb5a0d27fce648cdd4c6e686038282b64ffee7f42b7238a78552c91948d11', 'length': 616, 'tuf_version': 3, 'apply_state': 2, 'apply_error': None}], 'config': [{'internal_order': ['flare-log-level.trace', 'flare-log-level.debug', 'flare-log-level.info', 'flare-log-level.warn', 'flare-log-level.error', 'flare-log-level.critical', 'flare-log-level.off'], 'order': []}, {'id': 'f6c80fdcc00b702c54ff6ae5ff2ac7f16d9afef109bdf53ee990376455301ab2', 'revision': 1715109076236, 'schema_version': 'v1.0.0', 'action': 'enable', 'lib_config': {'library_language': 'all', 'library_version': 'latest', 'service_name': 'zachs-python-app', 'env': 'zachariah', 'tracing_enabled': True, 'dynamic_sampling_enabled': False, 'tracing_tags': ['rc:works'], 'tracing_sampling_rules': [{'service': 'zachs-python-app', 'provenance': 'customer', 'resource': 'GET /', 'sample_rate': 0.01}, {'service': 'zachs-python-app', 'provenance': 'customer', 'resource': '', 'sample_rate': 1}]}, 'service_target': {'service': 'zachs-python-app', 'env': 'zachariah'}}], 'shared_data_counter': 1} ``` The python tracer’s implementation of pulling RC rules was brittle and relied upon data["config"][0] always having the lib_config dict. However, with tracer flares it seems the agent sometimes sends the payload with the flare info in that 0 position in the list, so instead we need to sometimes grab data["config"][1] . ## Checklist - [ ] Change(s) are motivated and described in the PR description - [ ] Testing strategy is described if automated tests are not included in the PR - [ ] Risks are described (performance impact, potential for breakage, maintainability) - [ ] Change is maintainable (easy to change, telemetry, documentation) - [ ] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) are followed or label `changelog/no-changelog` is set - [ ] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)) - [ ] Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [ ] If this PR changes the public interface, I've notified `@DataDog/apm-tees`. ## Reviewer Checklist - [x] Title is accurate - [x] All changes are related to the pull request's stated goal - [x] Description motivates each change - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - [x] Testing strategy adequately addresses listed risks - [x] Change is maintainable (easy to change, telemetry, documentation) - [x] Release note makes sense to a user of the library - [x] Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - [ ] Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) (cherry picked from commit 69f91ee)
dc64ec6
to
133837c
Compare
BenchmarksBenchmark execution time: 2024-05-09 13:53:43 Comparing candidate commit 3442e80 in PR branch Found 15 performance improvements and 10 performance regressions! Performance is the same for 176 metrics, 9 unstable metrics. scenario:coreapiscenario-core_dispatch_with_results_listeners_and_all_listeners
scenario:coreapiscenario-core_dispatch_with_results_no_listeners
scenario:coreapiscenario-get_item_missing
scenario:coreapiscenario-set_item
scenario:httppropagationextract-b3_single_headers
scenario:httppropagationextract-full_t_id_datadog_headers
scenario:httppropagationextract-invalid_trace_id_header
scenario:httppropagationextract-none_propagation_style
scenario:httppropagationextract-tracecontext_headers
scenario:httppropagationextract-valid_headers_all
scenario:httppropagationextract-wsgi_invalid_trace_id_header
scenario:httppropagationextract-wsgi_large_header_no_matches
scenario:httppropagationextract-wsgi_medium_header_no_matches
scenario:httppropagationextract-wsgi_medium_valid_headers_all
scenario:httppropagationinject-ids_only
scenario:httppropagationinject-with_dd_origin
scenario:httppropagationinject-with_tags_max_size
scenario:sethttpmeta-all-enabled
scenario:sethttpmeta-no-useragentvariant
scenario:sethttpmeta-useragentvariant_exists_2
scenario:sethttpmeta-useragentvariant_exists_3
scenario:span-start-finish
scenario:tracer-large
scenario:tracer-medium
scenario:tracer-small
|
Backport 69f91ee from #9196 to 2.8.
Remote config was broken entirely due to the addition of tracer flare data in the config sent from the agent. Example incoming RC config:
The python tracer’s implementation of pulling RC rules was brittle and relied upon data["config"][0] always having the lib_config dict. However, with tracer flares it seems the agent sometimes sends the payload with the flare info in that 0 position in the list, so instead we need to sometimes grab data["config"][1] .
Checklist
changelog/no-changelog
is set@DataDog/apm-tees
.Reviewer Checklist