-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add KeyValue support for Observation.Event #5238
Comments
Thanks for the issue! I think providing a simple implementation for this wouldn't be too hard, I'm a bit concerned though about two things:
|
Sure. There are multiple places where we can use the
|
I've gone ahead and marked this as |
Thank you, @shakuzen! I want to study a bit deeper the Micrometer implementation for Spans first, and then I'll see if I can volunteer for helping with this feature. My main use case right now for this feature would be to instrument LLM-powered applications and optionally include the prompt and completion content in Span events. Span attributes would not be the best choice for such data because they could be too long, whereas Span attributes are better suitable for longer content (such as exception stacktrace). That's also a requirement to adhere to the OpenTelemetry Semantic Conventions for Generative AI (see: https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/#events). I'm currently working on instrumenting and configuring observability for Spring AI (first part already delivered in spring-projects/spring-ai#954). Eventually, this feature would be used there. |
@shakuzen I've started doing some analysis to figure out the size of the task. One question I have so far is how you would like to support the different data types for event attributes in a span. OpenTelemetry relies on an |
Please describe the feature request.
Currently,
Observation.Event
supports only providing a name (and contextual name). The enhancement request is to allow the addition of low cardinality and high cardinality tags (aka attributes) to events.Rationale
This would allow the Observation handlers to use them appropriately for use cases like tagging the counters created from the events with more informative tags, key value-based spans/logging systems can use this to enhance search capabilities and enrich events with additional contextual information, etc.
Adding support for tags in events would also enable places where certain tags are associated with an event to be flushed immediately and remove references. Today, such information can only be added to Observation which might be long-lived. Also, we cannot add too many low cardinal tags to the observation as that would make it emit timers with too many attributes. Doing so in events would ease these off from timers and add to counters which are relatively cheaper compared to Timers.
The text was updated successfully, but these errors were encountered: