Currently, prompt content and completion can optionally be included as span attributes when model observability is enabled. That was a temporary solution because span attributes are not ideal for potentially long text.
This PR stores such content as span events instead whenever the underlying tracing technology supports them (i.e. OpenTelemetry), and it falls back on span attributes when the underlying tracing technology doesn't support span events (i.e. Zipkin/Brave).
The OpenTelemetry Semantic Conventions for GenAI also defines span events for the prompt content and completion data in the current release (1.27.0): https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/#events
The solution in this PR relies on Reflection. It can be simplified if and when this issue is solved: https://github.com/micrometer-metrics/tracing/issues/808.
In the future, when Micrometer supports span events, the fallback solution based on span attributes can be removed entirely (see: https://github.com/micrometer-metrics/micrometer/issues/5238).
Comment From: markpollack
merged in 3fa102e78ff7cc1a19d8d10da61cf4936c871ee1