8000 Gary/add llmobs svc functionalities traceid by gary-huang · Pull Request #8505 · DataDog/dd-trace-java · GitHub
[go: up one dir, main page]

Skip to content

Gary/add llmobs svc functionalities traceid #8505

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.

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

Closed
Prev Previous commit
Next Next commit
handle default model name and provider
  • Loading branch information
gary-huang committed Mar 26, 2025
commit a090459bf4dc45959debb80f42a4e927452c8e8a
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public class LLMObsSystem {

private static final Logger LOGGER = LoggerFactory.getLogger(LLMObsSystem.class);

private static final String CUSTOM_MODEL_VAL = "custom";

public static void start(Instrumentation inst, SharedCommunicationObjects sco) {
Config config = Config.get();
if (!config.isLlmObsEnabled()) {
Expand Down Expand Up @@ -57,7 +59,14 @@ public LLMObsSpan startLLMSpan(
new DDLLMObsSpan(
Tags.LLMOBS_LLM_SPAN_KIND, spanName, getMLApp(mlApp), sessionID, serviceName);

if (modelName == null || modelName.isEmpty()) {
modelName = CUSTOM_MODEL_VAL;
}
span.setTag(LLMObsTags.MODEL_NAME, modelName);

if (modelProvider == null || modelProvider.isEmpty()) {
modelProvider = CUSTOM_MODEL_VAL;
}
span.setTag(LLMObsTags.MODEL_PROVIDER, modelProvider);
return span;
}
Expand Down
0