relay_event_schema/protocol/
trace_attachment.rs

1use relay_protocol::{Annotated, Empty, FromValue, IntoValue, Object, Value};
2
3use crate::processor::ProcessValue;
4use crate::protocol::{Attributes, Timestamp, TraceId};
5
6use uuid::Uuid;
7
8/// Metadata for a trace attachment.
9#[derive(Clone, Debug, Default, PartialEq, Empty, FromValue, IntoValue, ProcessValue)]
10pub struct TraceAttachmentMeta {
11    /// The ID of the trace that the attachment belongs to.
12    #[metastructure(required = true, nonempty = true, trim = false)]
13    pub trace_id: Annotated<TraceId>,
14
15    /// Unique identifier for this attachment.
16    #[metastructure(required = true, nonempty = true, trim = false)]
17    pub attachment_id: Annotated<Uuid>,
18
19    /// Timestamp when the attachment was created.
20    #[metastructure(required = true, trim = false)]
21    pub timestamp: Annotated<Timestamp>,
22
23    /// Original filename of the attachment.
24    #[metastructure(pii = "true", max_chars = 256, max_chars_allowance = 40, trim = false)]
25    pub filename: Annotated<String>,
26
27    /// Content type of the attachment body.
28    #[metastructure(required = true, max_chars = 128, trim = false)]
29    pub content_type: Annotated<String>,
30
31    /// Arbitrary attributes on a trace attachment.
32    #[metastructure(pii = "maybe")]
33    pub attributes: Annotated<Attributes>,
34
35    /// Additional arbitrary fields for forwards compatibility.
36    #[metastructure(additional_properties, pii = "maybe")]
37    pub other: Object<Value>,
38}