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:

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

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Attribute key for MIME content type

Link copied to clipboard

Attribute key for base64-encoded data

Link copied to clipboard

Attribute key indicating whether media is "input" or "output"

Link copied to clipboard

Attribute key for media encoding type (base64 or url)

Link copied to clipboard

Attribute key for external URL reference