diff --git a/dd-trace-core/src/main/java/datadog/trace/common/writer/WriterFactory.java b/dd-trace-core/src/main/java/datadog/trace/common/writer/WriterFactory.java index 3f5fec92562..709de57b69f 100644 --- a/dd-trace-core/src/main/java/datadog/trace/common/writer/WriterFactory.java +++ b/dd-trace-core/src/main/java/datadog/trace/common/writer/WriterFactory.java @@ -181,25 +181,27 @@ private static RemoteApi createDDIntakeRemoteApi( TrackType trackType) { featuresDiscovery.discoverIfOutdated(); boolean evpProxySupported = featuresDiscovery.supportsEvpProxy(); + boolean useProxyApi = false; + + if (TrackType.LLMOBS == trackType) { + useProxyApi = evpProxySupported && !config.isLlmObsAgentlessEnabled(); + if (!evpProxySupported && !config.isLlmObsAgentlessEnabled()) { + // Agentless is forced due to lack of evp proxy support + boolean agentRunning = null != featuresDiscovery.getTraceEndpoint(); + if (agentRunning) { + log.info( + "LLM Observability configured to use agent proxy, but not compatible with agent version {}. Please upgrade to v7.55+.", + featuresDiscovery.getVersion()); + } else { + log.info("LLM Observability configured to use agent proxy, but agent is not running."); + } + log.info("LLM Observability will use agentless data submission instead."); + } - boolean useLlmObsAgentless = config.isLlmObsAgentlessEnabled() || !evpProxySupported; - if (useLlmObsAgentless && !config.isLlmObsAgentlessEnabled()) { - boolean agentRunning = null != featuresDiscovery.getTraceEndpoint(); - log.info( - "LLM Observability configured to use agent proxy, but is not compatible or agent is not running (agentRunning={}, compatible={})", - agentRunning, - evpProxySupported); - log.info( - "LLM Observability will use agentless data submission instead. Compatible agent versions are >=7.55.0 (found version={}", - featuresDiscovery.getVersion()); + } else if (TrackType.CITESTCOV == trackType || TrackType.CITESTCYCLE == trackType) { + useProxyApi = evpProxySupported && !config.isCiVisibilityAgentlessEnabled(); } - boolean useProxyApi = - (TrackType.LLMOBS == trackType && !useLlmObsAgentless) - || (evpProxySupported - && (TrackType.CITESTCOV == trackType || TrackType.CITESTCYCLE == trackType) - && !config.isCiVisibilityAgentlessEnabled()); - if (useProxyApi) { return DDEvpProxyApi.builder() .httpClient(commObjects.agentHttpClient)