Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 4 additions & 27 deletions ddtrace/settings/integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,54 +81,31 @@ def trace_query_string(self):
return self.global_config._http.trace_query_string

@property
def is_header_tracing_configured(self):
# type: (...) -> bool
def is_header_tracing_configured(self) -> bool:
"""Returns whether header tracing is enabled for this integration.

Will return true if traced headers are configured for this integration
or if they are configured globally.
"""
return self.http.is_header_tracing_configured or self.global_config._http.is_header_tracing_configured

def header_is_traced(self, header_name):
# type: (str) -> bool
"""
Returns whether or not the current header should be traced.
:param header_name: the header name
:type header_name: str
:rtype: bool
"""
def header_is_traced(self, header_name: str) -> bool:
"""Returns whether or not the current header should be traced."""
return self._header_tag_name(header_name) is not None

def _header_tag_name(self, header_name):
# type: (str) -> Optional[str]
def _header_tag_name(self, header_name: str) -> Optional[str]:
tag_name = self.http._header_tag_name(header_name)
if tag_name is None:
return self.global_config._header_tag_name(header_name)
return tag_name

def __getattr__(self, key):
if key in self.APP_ANALYTICS_CONFIG_NAMES:
self.app_analytics_deprecated_warning(key)
return super().__getattr__(key)

def __setattr__(self, key, value):
if key in self.APP_ANALYTICS_CONFIG_NAMES:
self.app_analytics_deprecated_warning(key)
return super().__setattr__(key, value)

def app_analytics_deprecated_warning(self, key):
deprecate(
f"{key} is deprecated",
message="Controlling ingestion via analytics is no longer supported. "
"See https://docs.datadoghq.com/tracing/legacy_app_analytics/"
"?code-lang=python#migrate-to-the-new-configuration-options",
category=DDTraceDeprecationWarning,
removal_version="4.0.0",
)

def get_analytics_sample_rate(self, use_global_config=False):
self.app_analytics_deprecated_warning("get_analytics_sample_rate")
return 1

def __repr__(self):
Expand Down
Loading