Skip to content

Commit a5cde1b

Browse files
Limit writer logs only when LLMObs is enabled (#9781)
1 parent 4391801 commit a5cde1b

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

dd-trace-core/src/main/java/datadog/trace/common/writer/WriterFactory.java

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -181,25 +181,27 @@ private static RemoteApi createDDIntakeRemoteApi(
181181
TrackType trackType) {
182182
featuresDiscovery.discoverIfOutdated();
183183
boolean evpProxySupported = featuresDiscovery.supportsEvpProxy();
184+
boolean useProxyApi = false;
185+
186+
if (TrackType.LLMOBS == trackType) {
187+
useProxyApi = evpProxySupported && !config.isLlmObsAgentlessEnabled();
188+
if (!evpProxySupported && !config.isLlmObsAgentlessEnabled()) {
189+
// Agentless is forced due to lack of evp proxy support
190+
boolean agentRunning = null != featuresDiscovery.getTraceEndpoint();
191+
if (agentRunning) {
192+
log.info(
193+
"LLM Observability configured to use agent proxy, but not compatible with agent version {}. Please upgrade to v7.55+.",
194+
featuresDiscovery.getVersion());
195+
} else {
196+
log.info("LLM Observability configured to use agent proxy, but agent is not running.");
197+
}
198+
log.info("LLM Observability will use agentless data submission instead.");
199+
}
184200

185-
boolean useLlmObsAgentless = config.isLlmObsAgentlessEnabled() || !evpProxySupported;
186-
if (useLlmObsAgentless && !config.isLlmObsAgentlessEnabled()) {
187-
boolean agentRunning = null != featuresDiscovery.getTraceEndpoint();
188-
log.info(
189-
"LLM Observability configured to use agent proxy, but is not compatible or agent is not running (agentRunning={}, compatible={})",
190-
agentRunning,
191-
evpProxySupported);
192-
log.info(
193-
"LLM Observability will use agentless data submission instead. Compatible agent versions are >=7.55.0 (found version={}",
194-
featuresDiscovery.getVersion());
201+
} else if (TrackType.CITESTCOV == trackType || TrackType.CITESTCYCLE == trackType) {
202+
useProxyApi = evpProxySupported && !config.isCiVisibilityAgentlessEnabled();
195203
}
196204

197-
boolean useProxyApi =
198-
(TrackType.LLMOBS == trackType && !useLlmObsAgentless)
199-
|| (evpProxySupported
200-
&& (TrackType.CITESTCOV == trackType || TrackType.CITESTCYCLE == trackType)
201-
&& !config.isCiVisibilityAgentlessEnabled());
202-
203205
if (useProxyApi) {
204206
return DDEvpProxyApi.builder()
205207
.httpClient(commObjects.agentHttpClient)

0 commit comments

Comments
 (0)