File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed
dd-java-agent/agent-llmobs/src/main/java/datadog/trace/llmobs Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,11 @@ public void SubmitEvaluation(
7070 Map <String , Object > tags ) {
7171 if (llmObsSpan == null ) {
7272 LOGGER .error ("null llm obs span provided, eval not recorded" );
73+ return ;
74+ }
75+
76+ if (mlApp == null || mlApp .isEmpty ()) {
77+ mlApp = defaultMLApp ;
7378 }
7479 String traceID = llmObsSpan .getTraceId ().toHexString ();
7580 long spanID = llmObsSpan .getSpanId ();
@@ -101,6 +106,11 @@ public void SubmitEvaluation(
101106 Map <String , Object > tags ) {
102107 if (llmObsSpan == null ) {
103108 LOGGER .error ("null llm obs span provided, eval not recorded" );
109+ return ;
110+ }
111+
112+ if (mlApp == null || mlApp .isEmpty ()) {
113+ mlApp = defaultMLApp ;
104114 }
105115 String traceID = llmObsSpan .getTraceId ().toHexString ();
106116 long spanID = llmObsSpan .getSpanId ();
Original file line number Diff line number Diff line change @@ -37,11 +37,15 @@ public LLMObsEval(
3737 this .ml_app = mlApp ;
3838 this .metric_type = metricType ;
3939 this .label = label ;
40- List <String > tagsList = new ArrayList <>(tags .size ());
41- for (Map .Entry <String , Object > entry : tags .entrySet ()) {
42- tagsList .add (entry .getKey () + ":" + entry .getValue ());
40+ if (tags != null ) {
41+ List <String > tagsList = new ArrayList <>(tags .size ());
42+ for (Map .Entry <String , Object > entry : tags .entrySet ()) {
43+ tagsList .add (entry .getKey () + ":" + entry .getValue ());
44+ }
45+ this .tags = tagsList ;
46+ } else {
47+ this .tags = null ;
4348 }
44- this .tags = tagsList ;
4549 }
4650
4751 public static final class Adapter extends JsonAdapter <LLMObsEval > {
You can’t perform that action at this time.
0 commit comments