Problem
In src/proxy/handlers/messages/span_attributes/message_attributes.rs, the function image_source_to_data_url currently constructs a full data:<media_type>;base64,<data> URI for ImageSource entries with type "base64". This value is propagated into gen_ai.* message JSON and OpenInference message content span properties.
This has two risks:
- Span size limits — A single inline image can easily exceed span size limits in observability backends (e.g., Jaeger, OTLP collectors), causing spans to be dropped or truncated.
- Data leakage — Full image payloads are recorded verbatim into telemetry, which may not be appropriate.
Expected Behaviour
image_source_to_data_url (and any callers) should record metadata only — e.g., media_type plus either the byte length or a short checksum/hash of source.data, or a sentinel like "inline-base64-omitted". Non-base64 sources (url type) should continue to return source.data unchanged. Downstream consumers (content_parts_from_blocks, stream output collector, etc.) should be updated to handle the metadata token.
References
/cc @bzp2010
Problem
In
src/proxy/handlers/messages/span_attributes/message_attributes.rs, the functionimage_source_to_data_urlcurrently constructs a fulldata:<media_type>;base64,<data>URI forImageSourceentries with type"base64". This value is propagated intogen_ai.*message JSON and OpenInference message content span properties.This has two risks:
Expected Behaviour
image_source_to_data_url(and any callers) should record metadata only — e.g.,media_typeplus either the byte length or a short checksum/hash ofsource.data, or a sentinel like"inline-base64-omitted". Non-base64 sources (urltype) should continue to returnsource.dataunchanged. Downstream consumers (content_parts_from_blocks, stream output collector, etc.) should be updated to handle the metadata token.References
/cc @bzp2010