-
Notifications
You must be signed in to change notification settings - Fork 423
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(configurations): remove deprecated tracing env vars #12176
Open
mabdinur
wants to merge
8
commits into
3.x-staging
Choose a base branch
from
munir/remove-deprecated-tracing-configs
base: 3.x-staging
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+134
−218
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
dfe2ef1
chore(configurations): remove deprecated env vars
mabdinur 58552d5
fix config suitspec
mabdinur 380a9f1
add rn and fmt
mabdinur d814243
fix bug
mabdinur 71f6642
fix otel tests
mabdinur 685b294
remove sampling env
mabdinur 7d36ec8
fmt
mabdinur 81e0b95
fix tests
mabdinur File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -274,9 +274,11 @@ def _parse_global_tags(s): | |
|
||
def _default_config() -> Dict[str, _ConfigItem]: | ||
return { | ||
# Remove the _trace_sample_rate property, _trace_sampling_rules should be the source of truth | ||
"_trace_sample_rate": _ConfigItem( | ||
default=1.0, | ||
envs=[("DD_TRACE_SAMPLE_RATE", float)], | ||
# trace_sample_rate is placeholder, this code will be removed up after v3.0 | ||
envs=[("trace_sample_rate", float)], | ||
), | ||
"_trace_sampling_rules": _ConfigItem( | ||
default=lambda: "", | ||
|
@@ -388,14 +390,6 @@ def __init__(self): | |
self._from_endpoint = ENDPOINT_FETCHED_CONFIG | ||
self._config = _default_config() | ||
|
||
sample_rate = os.getenv("DD_TRACE_SAMPLE_RATE") | ||
if sample_rate is not None: | ||
deprecate( | ||
"DD_TRACE_SAMPLE_RATE is deprecated", | ||
message="Please use DD_TRACE_SAMPLING_RULES instead.", | ||
removal_version="3.0.0", | ||
) | ||
|
||
# Use a dict as underlying storing mechanism for integration configs | ||
self._integration_configs = {} | ||
|
||
|
@@ -404,9 +398,6 @@ def __init__(self): | |
|
||
rate_limit = os.getenv("DD_TRACE_RATE_LIMIT") | ||
if rate_limit is not None and self._trace_sampling_rules in ("", "[]"): | ||
# This warning will be logged when DD_TRACE_SAMPLE_RATE is set. This is intentional. | ||
# Even though DD_TRACE_SAMPLE_RATE is treated as a global trace sampling rule, this configuration | ||
# is deprecated. We should always encourage users to set DD_TRACE_SAMPLING_RULES instead. | ||
log.warning( | ||
"DD_TRACE_RATE_LIMIT is set to %s and DD_TRACE_SAMPLING_RULES is not set. " | ||
"Tracer rate limiting is only applied to spans that match tracer sampling rules. " | ||
|
@@ -424,13 +415,9 @@ def __init__(self): | |
) | ||
self._trace_api = _get_config("DD_TRACE_API_VERSION") | ||
if self._trace_api == "v0.3": | ||
deprecate( | ||
"DD_TRACE_API_VERSION=v0.3 is deprecated", | ||
message="Traces will be submitted to the v0.4/traces agent endpoint instead.", | ||
removal_version="3.0.0", | ||
category=DDTraceDeprecationWarning, | ||
log.error( | ||
"Setting DD_TRACE_API_VERSION to ``v0.3`` is not supported. The default ``v0.5`` format will be used.", | ||
) | ||
self._trace_api = "v0.4" | ||
self._trace_writer_buffer_size = _get_config("DD_TRACE_WRITER_BUFFER_SIZE_BYTES", DEFAULT_BUFFER_SIZE, int) | ||
self._trace_writer_payload_size = _get_config( | ||
"DD_TRACE_WRITER_MAX_PAYLOAD_SIZE_BYTES", DEFAULT_MAX_PAYLOAD_SIZE, int | ||
|
@@ -454,18 +441,8 @@ def __init__(self): | |
|
||
self._span_traceback_max_size = _get_config("DD_TRACE_SPAN_TRACEBACK_MAX_SIZE", 30, int) | ||
|
||
# Master switch for turning on and off trace search by default | ||
# this weird invocation of getenv is meant to read the DD_ANALYTICS_ENABLED | ||
# legacy environment variable. It should be removed in the future | ||
self._analytics_enabled = _get_config(["DD_TRACE_ANALYTICS_ENABLED", "DD_ANALYTICS_ENABLED"], False, asbool) | ||
if self._analytics_enabled: | ||
deprecate( | ||
"Datadog App Analytics is deprecated and will be removed in a future version. " | ||
"App Analytics can be enabled via DD_TRACE_ANALYTICS_ENABLED and DD_ANALYTICS_ENABLED " | ||
"environment variables and ddtrace.config.analytics_enabled configuration. " | ||
"These configurations will also be removed.", | ||
category=DDTraceDeprecationWarning, | ||
) | ||
# DD_ANALYTICS_ENABLED is not longer supported, remove this functionatiy from all integrations in the future | ||
self._analytics_enabled = False | ||
self._client_ip_header = _get_config("DD_TRACE_CLIENT_IP_HEADER") | ||
self._retrieve_client_ip = _get_config("DD_TRACE_CLIENT_IP_ENABLED", False, asbool) | ||
|
||
|
@@ -512,15 +489,8 @@ def __init__(self): | |
|
||
self._128_bit_trace_id_enabled = _get_config("DD_TRACE_128_BIT_TRACEID_GENERATION_ENABLED", True, asbool) | ||
|
||
self._128_bit_trace_id_logging_enabled = _get_config("DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED", False, asbool) | ||
if self._128_bit_trace_id_logging_enabled: | ||
deprecate( | ||
"Using DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED is deprecated.", | ||
message="Log injection format is now configured automatically.", | ||
removal_version="3.0.0", | ||
category=DDTraceDeprecationWarning, | ||
) | ||
|
||
# Disabling DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED is not supported. Remove this configuration in the future. | ||
self._128_bit_trace_id_logging_enabled = True | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc: @mtoffl01 Not sure if we should pull this out into it's own PR. Maybe this could use it's own release note. |
||
self._sampling_rules = _get_config("DD_SPAN_SAMPLING_RULES") | ||
self._sampling_rules_file = _get_config("DD_SPAN_SAMPLING_RULES_FILE") | ||
|
||
|
@@ -572,18 +542,7 @@ def __init__(self): | |
["DD_TRACE_COMPUTE_STATS", "DD_TRACE_STATS_COMPUTATION_ENABLED"], trace_compute_stats_default, asbool | ||
) | ||
self._data_streams_enabled = _get_config("DD_DATA_STREAMS_ENABLED", False, asbool) | ||
|
||
legacy_client_tag_enabled = _get_config("DD_HTTP_CLIENT_TAG_QUERY_STRING") | ||
if legacy_client_tag_enabled is None: | ||
self._http_client_tag_query_string = _get_config("DD_TRACE_HTTP_CLIENT_TAG_QUERY_STRING", "true") | ||
else: | ||
deprecate( | ||
"DD_HTTP_CLIENT_TAG_QUERY_STRING is deprecated", | ||
message="Please use DD_TRACE_HTTP_CLIENT_TAG_QUERY_STRING instead.", | ||
removal_version="3.0.0", | ||
category=DDTraceDeprecationWarning, | ||
) | ||
self._http_client_tag_query_string = legacy_client_tag_enabled.lower() | ||
self._http_client_tag_query_string = _get_config("DD_TRACE_HTTP_CLIENT_TAG_QUERY_STRING", "true") | ||
|
||
dd_trace_obfuscation_query_string_regexp = _get_config( | ||
"DD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP", DD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP_DEFAULT | ||
|
@@ -613,15 +572,8 @@ def __init__(self): | |
# https://github.com/open-telemetry/opentelemetry-python/blob/v1.16.0/opentelemetry-api/src/opentelemetry/context/__init__.py#L53 | ||
os.environ["OTEL_PYTHON_CONTEXT"] = "ddcontextvars_context" | ||
self._subscriptions = [] # type: List[Tuple[List[str], Callable[[Config, List[str]], None]]] | ||
self._span_aggregator_rlock = _get_config("DD_TRACE_SPAN_AGGREGATOR_RLOCK", True, asbool) | ||
if self._span_aggregator_rlock is False: | ||
deprecate( | ||
"DD_TRACE_SPAN_AGGREGATOR_RLOCK is deprecated", | ||
message="Soon the ddtrace library will only support using threading.Rlock to " | ||
"aggregate and encode span data. If you need to disable the re-entrant lock and " | ||
"revert to using threading.Lock, please contact Datadog support.", | ||
removal_version="3.0.0", | ||
) | ||
# Disabled Span Aggregator Rlock is not supported. Remove this configuration in the future | ||
self._span_aggregator_rlock = True | ||
|
||
self._trace_methods = _get_config("DD_TRACE_METHODS") | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
releasenotes/notes/remove-deprecated-tracing-configs-c6711b57037576f6.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
upgrade: | ||
- | | ||
configurations: Drops support for deprecated tracing configurations. The following configurations are no longer supported: | ||
- DD_TRACE_SAMPLE_RATE, use DD_TRACE_SAMPLING_RULES instead. | ||
- DD_TRACE_API_VERSION=v0.3, the default ``v0.5`` version is used instead. | ||
- DD_ANALYTICS_ENABLED, Datadog Analytics is no longer supported. | ||
- DD_TRACE_ANALYTICS_ENABLED, Datadog Analytics is no longer supported. | ||
- DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED, this configuration can not be disabled. | ||
- DD_HTTP_CLIENT_TAG_QUERY_STRING, DD_TRACE_HTTP_CLIENT_TAG_QUERY_STRING should be used instead. | ||
- DD_TRACE_SPAN_AGGREGATOR_RLOCK, disabling the span aggregator rlock is no longer supported. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Similar to the changes above, should we log that analytics_enabled is not supported?