GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — LLM Obs SDK Mapper by gary-huang · Pull Request #8372 · DataDog/dd-trace-java

LLM Obs SDK Mapper #8372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
nayeem-kamal merged 20 commits into gary/llmobs-sdk-merge from gary/add-llm-obs-writer
Jul 8, 2025

Uh oh!

There was an error while loading. Please reload this page.

Merged

LLM Obs SDK Mapper #8372

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5134311
add APIs for llm obs
gary-huang Sep 19, 2024
b5c7a0a
add llm message class to support llm spans
gary-huang Mar 6, 2025
7f8f586
add llm message class to support llm spans
gary-huang Mar 6, 2025
9206dbe
impl llmobs agent and llmobs apis
gary-huang Jan 27, 2025
f5efd26
support llm messages with tool calls
gary-huang Mar 6, 2025
76740e9
handle default model name and provider
gary-huang Mar 26, 2025
5e66a2f
rm unneeded file
gary-huang Apr 11, 2025
75290af
impl llmobs agent and llmobs apis
gary-huang Jan 27, 2025
7b2db7c
impl llmobs agent
gary-huang Jan 27, 2025
d76c94d
working writer
gary-huang Feb 7, 2025
e0b4510
add support for llm message and tool calls
gary-huang Mar 6, 2025
52d3502
cleaned up whitespace
Jul 2, 2025
f54c468
resolve merge conflicts
Jul 2, 2025
688d984
remaining merge conflicts
Jul 2, 2025
e62d569
merge with feature branch
Jul 2, 2025
157e53e
fix bad method call
Jul 2, 2025
ade08ca
fixed llmobs intake creation if llmobs not enabled
Jul 3, 2025
973c09f
removed print statements
Jul 3, 2025
1eb8db3
added tests for llmobsspanmapper
Jul 7, 2025
75d85a2
fixed coverage for tags
Jul 7, 2025
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

2 changes: 1 addition & 1 deletion 2 dd-java-agent/agent-jmxfetch/integrations-core
Show comments
Open in desktop
Submodule integrations-core updated 3586 files
1 change: 1 addition & 0 deletions 1 dd-trace-api/build.gradle
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ excludedClassesCoverage += [
'datadog.trace.context.NoopTraceScope',
'datadog.trace.payloadtags.PayloadTagsData',
'datadog.trace.payloadtags.PayloadTagsData.PathAndValue',
'datadog.trace.api.llmobs.LLMObsTags',
]

description = 'dd-trace-api'
Expand Down
1 change: 1 addition & 0 deletions 1 dd-trace-api/src/main/java/datadog/trace/api/DDSpanTypes.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class DDSpanTypes {
public static final String PROTOBUF = "protobuf";

public static final String MULE = "mule";

public static final String VALKEY = "valkey";
public static final String WEBSOCKET = "websocket";

Expand Down
2 changes: 2 additions & 0 deletions 2 dd-trace-core/build.gradle
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ excludedClassesCoverage += [
// Interface with an empty defender method
'datadog.trace.core.propagation.HttpCodec.Extractor',
'datadog.trace.core.flare.*',
'datadog.trace.llmobs.writer.ddintake.LLMObsSpanMapper',
'datadog.trace.llmobs.writer.ddintake.LLMObsSpanMapper.PayloadV1',
// FIXME(DSM): test coverage needed
'datadog.trace.core.datastreams.DataStreamContextInjector',
'datadog.trace.common.sampling.TraceSamplingRules.RuleAdapter',
Expand Down
37 changes: 32 additions & 5 deletions 37 dd-trace-core/src/main/java/datadog/trace/common/writer/WriterFactory.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public static Writer createWriter(
if (!DD_AGENT_WRITER_TYPE.equals(configuredType)
&& !DD_INTAKE_WRITER_TYPE.equals(configuredType)) {
log.warn(
"Writer type not configured correctly: Type {} not recognized. Ignoring", configuredType);
"Writer type not configured correctly: Type {} not recognized. Ignoring ",
configuredType);
configuredType = datadog.trace.api.ConfigDefaults.DEFAULT_AGENT_WRITER_TYPE;
}

Expand All @@ -84,14 +85,22 @@ public static Writer createWriter(

// The AgentWriter doesn't support the CI Visibility protocol. If CI Visibility is
// enabled, check if we can use the IntakeWriter instead.
if (DD_AGENT_WRITER_TYPE.equals(configuredType) && config.isCiVisibilityEnabled()) {
if (DD_AGENT_WRITER_TYPE.equals(configuredType) && (config.isCiVisibilityEnabled())) {
if (featuresDiscovery.supportsEvpProxy() || config.isCiVisibilityAgentlessEnabled()) {
configuredType = DD_INTAKE_WRITER_TYPE;
} else {
log.info(
"CI Visibility functionality is limited. Please upgrade to Agent v6.40+ or v7.40+ or enable Agentless mode.");
}
}
if (DD_AGENT_WRITER_TYPE.equals(configuredType) && (config.isLlmObsEnabled())) {
if (featuresDiscovery.supportsEvpProxy() || config.isLlmObsAgentlessEnabled()) {
configuredType = DD_INTAKE_WRITER_TYPE;
} else {
log.info("LLM Observability functionality is limited.");
// TODO: add supported agent version to this log line for llm obs
}
}

RemoteWriter remoteWriter;
if (DD_INTAKE_WRITER_TYPE.equals(configuredType)) {
Expand All @@ -117,7 +126,11 @@ public static Writer createWriter(
createDDIntakeRemoteApi(config, commObjects, featuresDiscovery, TrackType.CITESTCOV);
builder.addTrack(TrackType.CITESTCOV, coverageApi);
}

if (config.isLlmObsEnabled()) {
final RemoteApi llmobsApi =
createDDIntakeRemoteApi(config, commObjects, featuresDiscovery, TrackType.LLMOBS);
builder.addTrack(TrackType.LLMOBS, llmobsApi);
}
remoteWriter = builder.build();

} else { // configuredType == DDAgentWriter
Expand Down Expand Up @@ -173,20 +186,34 @@ private static RemoteApi createDDIntakeRemoteApi(
SharedCommunicationObjects commObjects,
DDAgentFeaturesDiscovery featuresDiscovery,
TrackType trackType) {
if (featuresDiscovery.supportsEvpProxy() && !config.isCiVisibilityAgentlessEnabled()) {
boolean evpProxySupported = featuresDiscovery.supportsEvpProxy();
boolean useProxyApi =
(evpProxySupported && TrackType.LLMOBS == trackType && !config.isLlmObsAgentlessEnabled())
|| (evpProxySupported
&& (TrackType.CITESTCOV == trackType || TrackType.CITESTCYCLE == trackType)
&& !config.isCiVisibilityAgentlessEnabled());

if (useProxyApi) {
return DDEvpProxyApi.builder()
.httpClient(commObjects.okHttpClient)
.agentUrl(commObjects.agentUrl)
.evpProxyEndpoint(featuresDiscovery.getEvpProxyEndpoint())
.trackType(trackType)
.compressionEnabled(featuresDiscovery.supportsContentEncodingHeadersWithEvpProxy())
.build();

} else {
HttpUrl hostUrl = null;
String llmObsAgentlessUrl = config.getLlMObsAgentlessUrl();

if (config.getCiVisibilityAgentlessUrl() != null) {
hostUrl = HttpUrl.get(config.getCiVisibilityAgentlessUrl());
log.info("Using host URL '{}' to report CI Visibility traces in Agentless mode.", hostUrl);
} else if (config.isLlmObsEnabled()
&& config.isLlmObsAgentlessEnabled()
&& llmObsAgentlessUrl != null
&& !llmObsAgentlessUrl.isEmpty()) {
hostUrl = HttpUrl.get(llmObsAgentlessUrl);
log.info("Using host URL '{}' to report LLM Obs traces in Agentless mode.", hostUrl);
}
return DDIntakeApi.builder()
.hostUrl(hostUrl)
Expand Down
3 changes: 3 additions & 0 deletions 3 ...race-core/src/main/java/datadog/trace/common/writer/ddintake/DDIntakeMapperDiscovery.java
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import datadog.trace.civisibility.writer.ddintake.CiTestCycleMapperV1;
import datadog.trace.common.writer.RemoteMapper;
import datadog.trace.common.writer.RemoteMapperDiscovery;
import datadog.trace.llmobs.writer.ddintake.LLMObsSpanMapper;

/**
* Mapper discovery logic when a DDIntake is used. The mapper is discovered based on a backend
Expand Down Expand Up @@ -40,6 +41,8 @@ public void discover() {
mapper = new CiTestCycleMapperV1(wellKnownTags, compressionEnabled);
} else if (TrackType.CITESTCOV.equals(trackType)) {
mapper = new CiTestCovMapperV2(compressionEnabled);
} else if (TrackType.LLMOBS.equals(trackType)) {
mapper = new LLMObsSpanMapper();
} else {
mapper = RemoteMapper.NO_OP;
}
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.