UploadableMediaContentAttributeKeys
OpenTelemetry attribute key generator for uploadable media content metadata.
Generates indexed attribute keys for tracing media content (images, audio, documents) in spans. Each media item gets a unique index, and this class provides type-safe access to its attributes. Used internally by tracing adapters to attach media metadata to telemetry spans.
Attribute Structure
Each media item has the following attributes:
type: Encoding type (SupportedMediaContentTypes.BASE64 or SupportedMediaContentTypes.URL)
field: Whether media is "input" or "output"
url: External URL (for URL type)
contentType: MIME type (e.g., "image/png", "audio/mp3")
data: Base64-encoded data (for BASE64 type)
Example
val keys = UploadableMediaContentAttributeKeys.forIndex(0)
span.setAttribute(keys.type,
SupportedMediaContentTypes.BASE64.type /* i.e., "base64" */)
span.setAttribute(keys.field, "input")
span.setAttribute(keys.contentType, "image/png")
span.setAttribute(keys.data, base64EncodedData)
// Results in attributes like:
// custom.uploadableMediaContent.0.type = "base64"
// custom.uploadableMediaContent.0.field = "input"
// custom.uploadableMediaContent.0.contentType = "image/png"
// custom.uploadableMediaContent.0.data = "iVBORw0KGg..."See also
Properties
Attribute key for MIME content type
Attribute key for base64-encoded data
Attribute key indicating whether media is "input" or "output"
Attribute key for media encoding type (base64 or url)
Attribute key for external URL reference