@@ -11,46 +11,42 @@ use crate::protocol::{
11
11
} ;
12
12
13
13
#[ derive( Clone , Debug , Default , PartialEq , Empty , FromValue , IntoValue , ProcessValue ) ]
14
- #[ metastructure( process_func = "process_span" , value_type = "Span" ) ]
14
+ #[ metastructure( process_func = "process_span" , value_type = "Span" , trim = false ) ]
15
15
pub struct Span {
16
16
/// Timestamp when the span was ended.
17
- #[ metastructure( required = true , trim = false ) ]
17
+ #[ metastructure( required = true ) ]
18
18
pub timestamp : Annotated < Timestamp > ,
19
19
20
20
/// Timestamp when the span started.
21
- #[ metastructure( required = true , trim = false ) ]
21
+ #[ metastructure( required = true ) ]
22
22
pub start_timestamp : Annotated < Timestamp > ,
23
23
24
24
/// The amount of time in milliseconds spent in this span,
25
25
/// excluding its immediate child spans.
26
- #[ metastructure( trim = false ) ]
27
26
pub exclusive_time : Annotated < f64 > ,
28
27
29
28
/// Span type (see `OperationType` docs).
30
- #[ metastructure( max_chars = 128 , trim = false ) ]
29
+ #[ metastructure( max_chars = 128 ) ]
31
30
pub op : Annotated < OperationType > ,
32
31
33
32
/// The Span id.
34
- #[ metastructure( required = true , trim = false ) ]
33
+ #[ metastructure( required = true ) ]
35
34
pub span_id : Annotated < SpanId > ,
36
35
37
36
/// The ID of the span enclosing this span.
38
- #[ metastructure( trim = false ) ]
39
37
pub parent_span_id : Annotated < SpanId > ,
40
38
41
39
/// The ID of the trace the span belongs to.
42
- #[ metastructure( required = true , trim = false ) ]
40
+ #[ metastructure( required = true ) ]
43
41
pub trace_id : Annotated < TraceId > ,
44
42
45
43
/// A unique identifier for a segment within a trace (8 byte hexadecimal string).
46
44
///
47
45
/// For spans embedded in transactions, the `segment_id` is the `span_id` of the containing
48
46
/// transaction.
49
- #[ metastructure( trim = false ) ]
50
47
pub segment_id : Annotated < SpanId > ,
51
48
52
49
/// Whether or not the current span is the root of the segment.
53
- #[ metastructure( trim = false ) ]
54
50
pub is_segment : Annotated < bool > ,
55
51
56
52
/// Indicates whether a span's parent is remote.
@@ -62,66 +58,61 @@ pub struct Span {
62
58
/// - `empty`: unknown
63
59
/// - `false`: is not remote
64
60
/// - `true`: is remote
65
- #[ metastructure( trim = false ) ]
66
61
pub is_remote : Annotated < bool > ,
67
62
68
63
/// The status of a span.
69
- #[ metastructure( trim = false ) ]
70
64
pub status : Annotated < SpanStatus > ,
71
65
72
66
/// Human readable description of a span (e.g. method URL).
73
- #[ metastructure( pii = "maybe" , trim = false ) ]
67
+ #[ metastructure( pii = "maybe" ) ]
74
68
pub description : Annotated < String > ,
75
69
76
70
/// Arbitrary tags on a span, like on the top-level event.
77
- #[ metastructure( pii = "maybe" , trim = false ) ]
71
+ #[ metastructure( pii = "maybe" ) ]
78
72
pub tags : Annotated < Object < JsonLenientString > > ,
79
73
80
74
/// The origin of the span indicates what created the span (see [OriginType] docs).
81
- #[ metastructure( max_chars = 128 , allow_chars = "a-zA-Z0-9_." , trim = false ) ]
75
+ #[ metastructure( max_chars = 128 , allow_chars = "a-zA-Z0-9_." ) ]
82
76
pub origin : Annotated < OriginType > ,
83
77
84
78
/// ID of a profile that can be associated with the span.
85
- #[ metastructure( trim = false ) ]
86
79
pub profile_id : Annotated < EventId > ,
87
80
88
81
/// Arbitrary additional data on a span.
89
82
///
90
83
/// Besides arbitrary user data, this object also contains SDK-provided fields used by the
91
84
/// product (see <https://develop.sentry.dev/sdk/performance/span-data-conventions/>).
92
- #[ metastructure( pii = "true" , trim = false ) ]
85
+ #[ metastructure( pii = "true" ) ]
93
86
pub data : Annotated < SpanData > ,
94
87
95
88
/// Links from this span to other spans
96
- #[ metastructure( pii = "maybe" , trim = false ) ]
89
+ #[ metastructure( pii = "maybe" ) ]
97
90
pub links : Annotated < Array < SpanLink > > ,
98
91
99
92
/// Tags generated by Relay. These tags are a superset of the tags set on span metrics.
100
- #[ metastructure( trim = false ) ]
101
93
pub sentry_tags : Annotated < SentryTags > ,
102
94
103
95
/// Timestamp when the span has been received by Sentry.
104
- #[ metastructure( trim = false ) ]
105
96
pub received : Annotated < Timestamp > ,
106
97
107
98
/// Measurements which holds observed values such as web vitals.
108
- #[ metastructure( skip_serialization = "empty" , trim = false ) ]
99
+ #[ metastructure( skip_serialization = "empty" ) ]
109
100
#[ metastructure( omit_from_schema) ] // we only document error events for now
110
101
pub measurements : Annotated < Measurements > ,
111
102
112
103
/// Platform identifier.
113
104
///
114
105
/// See [`Event::platform`](`crate::protocol::Event::platform`).
115
- #[ metastructure( skip_serialization = "empty" , trim = false ) ]
106
+ #[ metastructure( skip_serialization = "empty" ) ]
116
107
pub platform : Annotated < String > ,
117
108
118
109
/// Whether the span is a segment span that was converted from a transaction.
119
- #[ metastructure( skip_serialization = "empty" , trim = false ) ]
110
+ #[ metastructure( skip_serialization = "empty" ) ]
120
111
pub was_transaction : Annotated < bool > ,
121
112
122
113
// TODO remove retain when the api stabilizes
123
114
/// Additional arbitrary fields for forwards compatibility.
124
- #[ metastructure( additional_properties, retain = true , pii = "maybe" , trim = false ) ]
115
+ #[ metastructure( additional_properties, retain = true , pii = "maybe" ) ]
125
116
pub other : Object < Value > ,
126
117
}
127
118
@@ -197,6 +188,7 @@ impl Getter for Span {
197
188
198
189
/// Indexable fields added by sentry (server-side).
199
190
#[ derive( Clone , Debug , Default , PartialEq , Empty , FromValue , IntoValue , ProcessValue ) ]
191
+ #[ metastructure( trim = false ) ]
200
192
pub struct SentryTags {
201
193
pub release : Annotated < String > ,
202
194
#[ metastructure( pii = "true" ) ]
@@ -351,6 +343,7 @@ impl Getter for SentryTags {
351
343
/// Besides arbitrary user data, this type also contains SDK-provided fields used by the
352
344
/// product (see <https://develop.sentry.dev/sdk/performance/span-data-conventions/>).
353
345
#[ derive( Clone , Debug , Default , PartialEq , Empty , FromValue , IntoValue , ProcessValue ) ]
346
+ #[ metastructure( trim = false ) ]
354
347
pub struct SpanData {
355
348
/// Mobile app start variant.
356
349
///
@@ -750,6 +743,7 @@ impl Getter for SpanData {
750
743
751
744
/// A link from a span to another span.
752
745
#[ derive( Clone , Debug , Default , PartialEq , Empty , FromValue , IntoValue , ProcessValue ) ]
746
+ #[ metastructure( trim = false ) ]
753
747
pub struct SpanLink {
754
748
/// The trace id of the linked span
755
749
#[ metastructure( required = true , trim = false ) ]
0 commit comments