How to Add Metadata to Span Inside a Trace Using GraphQL Mutation in TypeScript
Hey, I am trying to add meta data to span inside a trace (after the trace is completed) in typescript! Basically I have recommendation generated in a LLM call (each recommendation can be considered a card). I am then assigning children span id to each card and I can see them within the same trace in my project in arize. Now I can't seem to find a way to add metadata to each card(using the span ids) using code based on user input like accepted or declined (along with other fields am sending this as note field in graph ql). I tried using the graph ql api and I get updateAnnotation error even and no concrete error message. What’s the best way to proceed with this? This is my mutation and the error I get is “Failed to update annotations”. looking for ways to do it without python client GraphQL mutation: mutation addAnnotation( $annotationConfigId: ID! $modelId: ID! $spanId: String! $noteText: String! $annotationName: String! $annotationLabel: String! $annotationText: String! $startTime: DateTime! ) { updateAnnotations( input: { modelRecordContext: { recordId: $spanId modelId: $modelId modelEnvironment: tracing startTime: $startTime } annotationUpdates: [{ annotationConfigId: $annotationConfigId annotation: { name: $annotationName label: $annotationLabel text: $annotationText annotationType: Label } }] note: { text: $noteText } } ) { result { __typename ... on UpdateAnnotationSuccess { success } ... on UpdateAnnotationError { error } } } } Appreciate any help I can get Thanks
