Replies: 3 comments 1 reply
-
Ah actually the props tags are only set after the response so I can simplify my solution to a single chat client after the OTEL one that sets the tags and remove the things from the props. |
Beta Was this translation helpful? Give feedback.
-
We can tweak how that shows up. We did it that way based on how older versions of the otel spec specified how additional properties should show up. That's no longer a constraint, so we can do something else if desirable. |
Beta Was this translation helpful? Give feedback.
-
https://github.com/dotnet/extensions/releases/tag/v9.9.0 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm exporting the gen ai spans to Langfuse and I'd like to add the user (user.id) and session (session.id) to that span as expected from Langfuse. I thought I could use ChatOptions.AdditionalProperties but the key/values get formatted in a specific way
extensions/src/Libraries/Microsoft.Extensions.AI/ChatCompletion/OpenTelemetryChatClient.cs
Lines 473 to 484 in d6718f6
The work-around I'm thinking about is to create two DelegatingChatClient and place them around the OpenTelemetryChatClient. One would extract the data from
AdditionalProperties
and set it to an AsyncLocal and the second would grab them that and set the tag on the active span, being the one from OpenTelemetryChatClient.That's pretty hacky. Is there a better way?
Beta Was this translation helpful? Give feedback.
All reactions