diff --git a/ddtrace/_logger.py b/ddtrace/_logger.py index 5bde0c11da2..8eca29d15cc 100644 --- a/ddtrace/_logger.py +++ b/ddtrace/_logger.py @@ -139,7 +139,9 @@ def _configure_ddtrace_native_logger(): from .settings._config import config if config._trace_writer_native: - backend = get_config("_DD_NATIVE_LOGGING_BACKEND", "file", report_telemetry=True) + backend = get_config("_DD_NATIVE_LOGGING_BACKEND", report_telemetry=True) + if not backend: + return kwargs = {"output": backend} if backend == "file": kwargs["path"] = get_config("_DD_NATIVE_LOGGING_FILE_PATH", "native.log", report_telemetry=True) diff --git a/ddtrace/settings/_config.py b/ddtrace/settings/_config.py index 96c66bb5fce..55febc0836b 100644 --- a/ddtrace/settings/_config.py +++ b/ddtrace/settings/_config.py @@ -475,7 +475,7 @@ def __init__(self): self._trace_writer_log_err_payload = _get_config("_DD_TRACE_WRITER_LOG_ERROR_PAYLOADS", False, asbool) # Use the NativeWriter instead of the AgentWriter - self._trace_writer_native = _get_config("_DD_TRACE_WRITER_NATIVE", False, asbool) + self._trace_writer_native = _get_config("_DD_TRACE_WRITER_NATIVE", True, asbool) # TODO: Remove the configurations below. ddtrace.internal.agent.config should be used instead. self._trace_agent_url = _get_config("DD_TRACE_AGENT_URL") diff --git a/tests/integration/test_integration.py b/tests/integration/test_integration.py index 60aa25db059..cbbd55d5ad1 100644 --- a/tests/integration/test_integration.py +++ b/tests/integration/test_integration.py @@ -522,6 +522,7 @@ def test_trace_with_invalid_payload_generates_error_log(): 0, "http://localhost:8126/v0.5/traces", "Invalid format: Unable to read payload len", + extra={"send_to_telemetry": False}, ) ] ) @@ -557,6 +558,7 @@ def test_trace_with_invalid_payload_logs_payload_when_LOG_ERROR_PAYLOADS(): "http://localhost:8126/v0.5/traces", "Invalid format: Unable to read payload len", "6261645f7061796c6f6164", + extra={"send_to_telemetry": False}, ) ] ) diff --git a/tests/telemetry/test_writer.py b/tests/telemetry/test_writer.py index 04a4a7e79db..7d2e9008675 100644 --- a/tests/telemetry/test_writer.py +++ b/tests/telemetry/test_writer.py @@ -474,7 +474,7 @@ def test_app_started_event_configuration_override(test_agent_session, run_python {"name": "_DD_IAST_LAZY_TAINT", "origin": "default", "value": False}, {"name": "_DD_IAST_USE_ROOT_SPAN", "origin": "default", "value": False}, {"name": "_DD_TRACE_WRITER_LOG_ERROR_PAYLOADS", "origin": "default", "value": False}, - {"name": "_DD_TRACE_WRITER_NATIVE", "origin": "default", "value": False}, + {"name": "_DD_TRACE_WRITER_NATIVE", "origin": "default", "value": True}, {"name": "instrumentation_source", "origin": "code", "value": "manual"}, {"name": "python_build_gnu_type", "origin": "unknown", "value": sysconfig.get_config_var("BUILD_GNU_TYPE")}, {"name": "python_host_gnu_type", "origin": "unknown", "value": sysconfig.get_config_var("HOST_GNU_TYPE")},