fix(tracing): otel tracing input/output message onModelCall#2156
fix(tracing): otel tracing input/output message onModelCall#2156rudy2steiner wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR adds GenAI semantic convention attributes for input/output messages on the chat span in OtelTracingMiddleware.onModelCall(). The implementation is clean and well-structured: input messages (with roles, content blocks, tool definitions) are serialized on the SpanBuilder before startSpan(), streamed output (text, reasoning, tool calls) is accumulated via doOnNext and recorded in setModelResponseAttributes when ModelCallEndEvent arrives — correctly before span.end() in doOnComplete. Test coverage is solid. The main concern is the lack of an opt-out mechanism for content recording, which could expose sensitive data in production environments.
(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR adds GenAI semantic convention attributes for input/output messages on the chat span in OtelTracingMiddleware.onModelCall(). The implementation is clean and well-structured: input messages (with roles, content blocks, tool definitions) are serialized on the SpanBuilder before startSpan(), streamed output (text, reasoning, tool calls) is accumulated via doOnNext and recorded in setModelResponseAttributes when ModelCallEndEvent arrives — correctly before span.end() in doOnComplete. Test coverage is solid. The main concern is the lack of an opt-out mechanism for content recording, which could expose sensitive data in production environments.
(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)
|
@jujn could you review this PR when you have time? |
Description
Fixes #1939 model-call OpenTelemetry tracing to record GenAI semantic input/output content on chat spans, including messages, reasoning, tool calls, tool results, tool definitions, request options et.
Main Changes