3232from ddtrace .internal .serverless import in_azure_function
3333from ddtrace .internal .serverless import in_gcp_function
3434from ddtrace .internal .settings import env
35+ from ddtrace .internal .settings ._agentless import config as agentless_config
3536from ddtrace .internal .telemetry import get_config as _get_config
3637from ddtrace .internal .telemetry import telemetry_writer
3738from ddtrace .internal .telemetry import validate_and_report_otel_metrics_exporter_enabled
@@ -468,6 +469,14 @@ def __init__(self) -> None:
468469 self ._debug_mode = _get_config ("DD_TRACE_DEBUG" , False , asbool , "OTEL_LOG_LEVEL" )
469470 self ._startup_logs_enabled = _get_config ("DD_TRACE_STARTUP_LOGS" , False , asbool )
470471
472+ self ._dd_api_key = agentless_config .api_key
473+ self ._dd_site = agentless_config .site
474+ self ._agentless_enabled = agentless_config .enabled
475+ for _name , _value , _origin in agentless_config .reported_configuration ():
476+ telemetry_writer .add_configuration (_name , _value , _origin )
477+
478+ self ._dd_app_key = _get_config ("DD_APP_KEY" , report_telemetry = False )
479+
471480 self ._trace_rate_limit : int = _get_config ("DD_TRACE_RATE_LIMIT" , DEFAULT_SAMPLING_RATE_LIMIT , int )
472481 if self ._trace_rate_limit != DEFAULT_SAMPLING_RATE_LIMIT and self ._trace_sampling_rules in ("" , "[]" ):
473482 log .warning (
@@ -678,7 +687,7 @@ def __init__(self) -> None:
678687 log .warning ("Invalid obfuscation pattern, disabling query string tracing" , exc_info = True )
679688 self ._http_tag_query_string = False # Disable query string tagging if malformed obfuscation pattern
680689
681- self ._ci_visibility_agentless_enabled = _get_config ( "DD_CIVISIBILITY_AGENTLESS_ENABLED" , False , asbool )
690+ self ._ci_visibility_agentless_enabled = agentless_config . ci_visibility
682691 self ._ci_visibility_agentless_url = _get_config ("DD_CIVISIBILITY_AGENTLESS_URL" , "" )
683692 self ._ci_visibility_intelligent_testrunner_enabled = _get_config ("DD_CIVISIBILITY_ITR_ENABLED" , True , asbool )
684693 self ._ci_visibility_log_level = _get_config ("DD_CIVISIBILITY_LOG_LEVEL" , "info" )
@@ -701,11 +710,7 @@ def __init__(self) -> None:
701710
702711 self ._trace_methods = _get_config ("DD_TRACE_METHODS" )
703712
704- self ._dd_api_key = _get_config ("DD_API_KEY" , report_telemetry = False )
705- self ._dd_app_key = _get_config ("DD_APP_KEY" , report_telemetry = False )
706- self ._dd_site = _get_config ("DD_SITE" , "datadoghq.com" )
707-
708- self ._llmobs_agentless_enabled = _get_config ("DD_LLMOBS_AGENTLESS_ENABLED" , None , asbool )
713+ self ._llmobs_agentless_enabled = agentless_config .llmobs
709714 self ._llmobs_instrumented_proxy_urls = _get_config (
710715 "DD_LLMOBS_INSTRUMENTED_PROXY_URLS" , None , lambda x : set (x .strip ().split ("," ))
711716 )
@@ -761,7 +766,7 @@ def __init__(self) -> None:
761766 "DD_TRACE_EXPERIMENTAL_LONG_RUNNING_INITIAL_FLUSH_INTERVAL" , default = 10.0 , modifier = float
762767 )
763768 # When True, traces are sent via the JSON span intake (agentless EvP), e.g. browser-intake-*.
764- self ._trace_agentless_enabled = _get_config ( "_DD_APM_TRACING_AGENTLESS_ENABLED" , False , asbool )
769+ self ._trace_agentless_enabled = agentless_config . apm_tracing
765770 if self ._trace_agentless_enabled :
766771 log .debug (
767772 "APM Agentless enabled: health metrics and client-side stats are disabled. "
0 commit comments