-
Notifications
You must be signed in to change notification settings - Fork 420
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
chore(configs): make rc and http configs internal [3.0] [backport #12055 2.20] #12086
base: 2.20
Are you sure you want to change the base?
Conversation
Prefixes the following `ddtrace.config` attributes with an `_`. These attributes are internal to the tracer and should not be referenced or modified by users: - http - http_server - trace_headers - header_is_traced - convert_rc_trace_sampling_rules - enable_remote_configuration - get_from Users should enable remote configuration and set `http` configurations via environment variables. - [ ] PR author has checked that all the criteria below are met - The PR description includes an overview of the change - The PR description articulates the motivation for the change - The change includes tests OR the PR description describes a testing strategy - The PR description notes risks associated with the change, if any - Newly-added code is easy to change - The change follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) - The change includes or references documentation updates if necessary - Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [ ] Reviewer has checked that all the criteria below are met - Title is accurate - All changes are related to the pull request's stated goal - Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - Testing strategy adequately addresses listed risks - Newly-added code is easy to change - Release note makes sense to a user of the library - If necessary, 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)
|
else: | ||
return None |
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.
# If no data is submitted then the RC config has been deleted. Revert the settings. | ||
base_rc_config = {n: None for n in self._config} | ||
|
||
if config and "lib_config" in config: |
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.
def get_error_ranges(error_range_str): | ||
# type: (str) -> List[Tuple[int, int]] | ||
error_ranges = [] | ||
error_range_str = error_range_str.strip() |
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.
break | ||
telemetry_writer.add_configuration(self._name, self.value(), self.source()) | ||
|
||
def set_value_source(self, value: Any, source: _ConfigSource) -> None: |
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.
🟠 Code Quality Violation
do not use Any, use a concrete type (...read more)
Use the Any
type very carefully. Most of the time, the Any
type is used because we do not know exactly what type is being used. If you want to specify that a value can be of any type, use object
instead of Any
.
Learn More
Example of a converted rule: | ||
'[{"sample_rate":1.0,"service":"my-service","resource":"*","name":"web.request","tags":{"care_about":"yes","region":"us-*"},provenance":"customer"}]' | ||
""" | ||
rc_rules = self._remove_invalid_rules(rc_rules) |
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.
""" | ||
# DEV: Use `getattr()` to call our `__getattr__` helper | ||
existing = getattr(self, integration) | ||
settings = deepcopy(settings) |
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.
Datadog ReportBranch report: ✅ 0 Failed, 130 Passed, 1468 Skipped, 4m 30.53s Total duration (36m 53.14s time saved) |
BenchmarksBenchmark execution time: 2025-01-24 22:34:48 Comparing candidate commit d278658 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 394 metrics, 2 unstable metrics. |
Backports: #12055
Checklist
Reviewer Checklist