Skip to content

Commit 1d0d5b3

Browse files
authored
refactor(di): rename upload_flush_interval to upload_interval_seconds (#13645)
Rename `upload_flush_interval` to `upload_interval_seconds` - Rename upload_flush_interval config to upload_interval_seconds - Add deprecation support for old upload.flush_interval config key - Update uploader to use new config attribute name - Deprecated config will be removed in version 4.0 - Add a release note documenting the change Using the old option will raise the following warning: > DeprecationWarning: DD_DYNAMIC_INSTRUMENTATION_UPLOAD_FLUSH_INTERVAL has been deprecated and will be removed in version 4.0. Use DD_DYNAMIC_INSTRUMENTATION_UPLOAD_INTERVAL_SECONDS instead Refs: DEBUG-3997 ## Checklist - [x] 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 Checklist - [x] 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)
1 parent 9292dbd commit 1d0d5b3

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

ddtrace/debugging/_uploader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class LogsIntakeUploaderV1(ForksafeAwakeablePeriodicService):
4545
RETRY_ATTEMPTS = 3
4646

4747
def __init__(self, interval: Optional[float] = None) -> None:
48-
super().__init__(interval if interval is not None else di_config.upload_flush_interval)
48+
super().__init__(interval if interval is not None else di_config.upload_interval_seconds)
4949

5050
self._queue = self.__queue__(encoder=LogSignalJsonEncoder(di_config.service_name), on_full=self._on_buffer_full)
5151
self._collector = self.__collector__(self._queue)

ddtrace/settings/dynamic_instrumentation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,13 @@ class DynamicInstrumentationConfig(DDConfig):
8686
help="Timeout in seconds for uploading Dynamic Instrumentation payloads",
8787
)
8888

89-
upload_flush_interval = DDConfig.v(
89+
upload_interval_seconds = DDConfig.v(
9090
float,
91-
"upload.flush_interval",
91+
"upload.interval_seconds",
9292
default=1.0, # seconds
9393
help_type="Float",
9494
help="Interval in seconds for flushing the dynamic logs upload queue",
95+
deprecations=[("upload.flush_interval", None, "4.0")],
9596
)
9697

9798
diagnostics_interval = DDConfig.v(
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
deprecations:
3+
- |
4+
dynamic instrumentation: The ``DD_DYNAMIC_INSTRUMENTATION_UPLOAD_FLUSH_INTERVAL`` environment variable has been
5+
deprecated in favor of ``DD_DYNAMIC_INSTRUMENTATION_UPLOAD_INTERVAL_SECONDS``. The old environment variable will be
6+
removed in a future major release.

tests/telemetry/test_writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ def test_app_started_event_configuration_override(test_agent_session, run_python
366366
{"name": "DD_DYNAMIC_INSTRUMENTATION_REDACTED_IDENTIFIERS", "origin": "default", "value": "set()"},
367367
{"name": "DD_DYNAMIC_INSTRUMENTATION_REDACTED_TYPES", "origin": "default", "value": "set()"},
368368
{"name": "DD_DYNAMIC_INSTRUMENTATION_REDACTION_EXCLUDED_IDENTIFIERS", "origin": "default", "value": "set()"},
369-
{"name": "DD_DYNAMIC_INSTRUMENTATION_UPLOAD_FLUSH_INTERVAL", "origin": "default", "value": 1.0},
369+
{"name": "DD_DYNAMIC_INSTRUMENTATION_UPLOAD_INTERVAL_SECONDS", "origin": "default", "value": 1.0},
370370
{"name": "DD_DYNAMIC_INSTRUMENTATION_UPLOAD_TIMEOUT", "origin": "default", "value": 30},
371371
{"name": "DD_ENV", "origin": "default", "value": None},
372372
{"name": "DD_ERROR_TRACKING_HANDLED_ERRORS", "origin": "default", "value": ""},

0 commit comments

Comments
 (0)