@@ -16,42 +16,53 @@ impl SetMetric for RelaySets {
16
16
17
17
/// Histogram metrics used by Relay.
18
18
pub enum RelayHistograms {
19
- /// The number of events in the queue as a percentage of the maximum number of events
20
- /// that can be stored in the queue ( 0 ... the queue is empty, 1 ... the queue is full
21
- /// and no additional events can be added).
22
- EventQueueSizePct ,
23
- /// The number of events in the queue. The event queue represents the events that are being
24
- /// processed at a particular time in Relay. Once a request is received the event has
25
- /// some preliminary (quick) processing to determine if it can be processed or it is
26
- /// rejected. Once this determination has been done the http request that
27
- /// created the event terminates and, if the request is to be further processed,
28
- /// the event enters a queue ( a virtual queue, the event is kept in a future that
29
- /// will resolve at some point in time).
30
- /// Once the event finishes processing and is sent downstream (i.e. the future is
31
- /// resolved and the event leaves relay) the event is considered handled and it
32
- /// leaves the queue ( the queue size is decremented).
33
- EventQueueSize ,
34
- /// The event size as seen by Relay after it is extracted from a request.
35
- EventSizeBytesRaw ,
36
- /// The event size as seen by Relay after it has been decompressed and decoded (e.g. from Base64).
37
- EventSizeBytesUncompressed ,
38
- /// Number of projects in the ProjectCache that are waiting for their state to be updated.
19
+ /// The number of envelopes in the queue as a percentage of the maximum number of envelopes that
20
+ /// can be stored in the queue.
21
+ ///
22
+ /// The value ranges from `0` (the queue is empty) to `1` (the queue is full and no additional
23
+ /// events can be added).
24
+ EnvelopeQueueSizePct ,
25
+ /// The number of envelopes in the queue.
26
+ ///
27
+ /// The event queue represents the envelopes that are being processed at a particular time in
28
+ /// Relay. Once a request is received, the envelope receives some preliminary (quick) processing
29
+ /// to determine if it can be processed or it is rejected. Once this determination has been
30
+ /// done, the http request that created the envelope terminates and, if the request is to be
31
+ /// further processed, the envelope enters a queue.
32
+ ///
33
+ /// Once the envelope finishes processing and is sent downstream, the envelope is considered
34
+ /// handled and it leaves the queue.
35
+ EnvelopeQueueSize ,
36
+ /// The size of the request body as seen by Relay after it is extracted from a request.
37
+ ///
38
+ /// For envelope requests, this is the full size of the envelope. For JSON store requests, this
39
+ /// is the size of the JSON body.
40
+ ///
41
+ /// If this request contains a base64 zlib compressed payload without a proper
42
+ /// `content-encoding` header, then this is the size before decompression.
43
+ RequestSizeBytesRaw ,
44
+ /// The size of the request body as seen by Relay after it has been decompressed and decoded in
45
+ /// case this request contains a base64 zlib compressed payload without a proper
46
+ /// `content-encoding` header. Otherwise, this metric is always equal to `event.size_bytes.raw`.
47
+ RequestSizeBytesUncompressed ,
48
+ /// Number of projects in the in-memory project cache that are waiting for their state to be
49
+ /// updated.
39
50
ProjectStatePending ,
40
- /// Number of project state requested from the Upstream for the current batch request.
51
+ /// Number of project states requested from the Upstream for the current batch request.
41
52
ProjectStateRequestBatchSize ,
42
53
/// Number of project states received from the Upstream for the current batch request.
43
54
ProjectStateReceived ,
44
- /// Number of project states currently held in the ProjectState cache.
55
+ /// Number of project states currently held in the in-memory project cache.
45
56
ProjectStateCacheSize ,
46
57
}
47
58
48
59
impl HistogramMetric for RelayHistograms {
49
60
fn name ( & self ) -> & ' static str {
50
61
match self {
51
- RelayHistograms :: EventQueueSizePct => "event.queue_size.pct" ,
52
- RelayHistograms :: EventQueueSize => "event.queue_size" ,
53
- RelayHistograms :: EventSizeBytesRaw => "event.size_bytes.raw" ,
54
- RelayHistograms :: EventSizeBytesUncompressed => "event.size_bytes.uncompressed" ,
62
+ RelayHistograms :: EnvelopeQueueSizePct => "event.queue_size.pct" ,
63
+ RelayHistograms :: EnvelopeQueueSize => "event.queue_size" ,
64
+ RelayHistograms :: RequestSizeBytesRaw => "event.size_bytes.raw" ,
65
+ RelayHistograms :: RequestSizeBytesUncompressed => "event.size_bytes.uncompressed" ,
55
66
RelayHistograms :: ProjectStatePending => "project_state.pending" ,
56
67
RelayHistograms :: ProjectStateRequestBatchSize => "project_state.request.batch_size" ,
57
68
RelayHistograms :: ProjectStateReceived => "project_state.received" ,
@@ -65,31 +76,29 @@ pub enum RelayTimers {
65
76
/// The time spent deserializing an event from a JSON byte array into the native data structure
66
77
/// on which Relay operates.
67
78
EventProcessingDeserialize ,
68
- /// Time spent running event processors on an event.
69
- /// Event processing happens before filtering.
79
+ /// Time spent running event processors on an event. Event processing happens before filtering.
70
80
#[ cfg( feature = "processing" ) ]
71
81
EventProcessingProcess ,
72
82
/// Time spent running filtering on an event.
73
83
#[ cfg( feature = "processing" ) ]
74
84
EventProcessingFiltering ,
75
85
/// Time spent checking for rate limits in Redis.
76
- /// Note that not all events are checked against Redis. After an event is rate limited
77
- /// for period A, any event using the same key coming during period A will be automatically
78
- /// rate limited without checking against Redis (the event will be simply discarded without
79
- /// being placed in the processing queue) .
86
+ ///
87
+ /// Note that not all events are checked against Redis. After an event is rate limited for the
88
+ /// first time, the rate limit is cached. Events coming in during this period will be discarded
89
+ /// earlier in the request queue and do not reach the processing queue.
80
90
#[ cfg( feature = "processing" ) ]
81
91
EventProcessingRateLimiting ,
82
- /// Time spent in data scrubbing for the current event.
92
+ /// Time spent in data scrubbing for the current event. Data scrubbing happens last before
93
+ /// serializing the event back to JSON.
83
94
EventProcessingPii ,
84
- /// Time spent converting the event from an Annotated<Event> into a String containing the JSON
85
- /// representation of the event.
95
+ /// Time spent converting the event from its in-memory reprsentation into a JSON string.
86
96
EventProcessingSerialization ,
87
- /// Represents the time spent between receiving the event in Relay (i.e. beginning of the
88
- /// request handling) up to the time before starting synchronous processing in the EventProcessor.
89
- EventWaitTime ,
90
- /// This is the time the event spends in the EventProcessor (i.e. the sync processing of the
91
- /// event).
92
- /// The time spent in synchronous event processing.
97
+ /// Time spent between receiving a request in Relay (that is, beginning of request handling) and
98
+ /// the start of synchronous processing in the EventProcessor. This metric primarily indicates
99
+ /// backlog in event processing.
100
+ EnvelopeWaitTime ,
101
+ /// The time spent in synchronous processing of envelopes.
93
102
///
94
103
/// This timing covers the end-to-end processing in the CPU pool and comprises:
95
104
///
@@ -102,10 +111,10 @@ pub enum RelayTimers {
102
111
/// - `event_processing.process`
103
112
/// - `event_processing.filtering`
104
113
/// - `event_processing.rate_limiting`
105
- EventProcessingTime ,
106
- /// The total time an event spends in Relay from the time it is received until it finishes
107
- /// processing.
108
- EventTotalTime ,
114
+ EnvelopeProcessingTime ,
115
+ /// The total time an envelope spends in Relay from the time it is received until it finishes
116
+ /// processing and has been submitted .
117
+ EnvelopeTotalTime ,
109
118
/// The total time spent during `ProjectCache.fetch_states` in which eviction of outdated
110
119
/// projects happens.
111
120
ProjectStateEvictionDuration ,
@@ -142,9 +151,9 @@ impl TimerMetric for RelayTimers {
142
151
RelayTimers :: EventProcessingRateLimiting => "event_processing.rate_limiting" ,
143
152
RelayTimers :: EventProcessingPii => "event_processing.pii" ,
144
153
RelayTimers :: EventProcessingSerialization => "event_processing.serialization" ,
145
- RelayTimers :: EventWaitTime => "event.wait_time" ,
146
- RelayTimers :: EventProcessingTime => "event.processing_time" ,
147
- RelayTimers :: EventTotalTime => "event.total_time" ,
154
+ RelayTimers :: EnvelopeWaitTime => "event.wait_time" ,
155
+ RelayTimers :: EnvelopeProcessingTime => "event.processing_time" ,
156
+ RelayTimers :: EnvelopeTotalTime => "event.total_time" ,
148
157
RelayTimers :: ProjectStateEvictionDuration => "project_state.eviction.duration" ,
149
158
RelayTimers :: ProjectStateRequestDuration => "project_state.request.duration" ,
150
159
RelayTimers :: ProjectIdRequestDuration => "project_id.request.duration" ,
@@ -155,20 +164,20 @@ impl TimerMetric for RelayTimers {
155
164
156
165
/// Counter metrics used by Relay
157
166
pub enum RelayCounters {
158
- /// Number of events accepted in the current time slot. This represents events that
159
- /// have successfully passed rate limits, filters and have been successfully handled.
160
- EventAccepted ,
161
- /// Number of events rejected in the current time slot. This includes events being rejected
162
- /// because they are malformed or any other error during processing (including filtered
163
- /// events, discarded events and rate limited events ).
164
- EventRejected ,
165
- /// Represents a group of counters, implemented with using tags. The following tags are
166
- /// present for each event outcome:
167
+ /// Number of envelopes accepted in the current time slot. This represents requests that have
168
+ /// successfully passed rate limits, filters and have been successfully handled.
169
+ EnvelopeAccepted ,
170
+ /// Number of envelopes rejected in the current time slot. This includes envelopes being
171
+ /// rejected because they are malformed or any other errors during processing (including
172
+ /// filtered events, invalid payloads and rate limits ).
173
+ EnvelopeRejected ,
174
+ /// Represents a group of counters incremented for every outcome emitted by Relay, implemented
175
+ /// with tags. The following tags are present for each event outcome:
167
176
///
168
- /// - `outcome` which is an `EventOutcome ` enumeration
177
+ /// - `outcome` which is an `Outcome ` enumeration
169
178
/// - `reason` which is the reason string for all outcomes that are not `Accepted`.
170
179
#[ cfg( feature = "processing" ) ]
171
- EventOutcomes ,
180
+ Outcomes ,
172
181
/// Counts the number of times a project state lookup is done. This includes requests
173
182
/// for projects that are cached and requests for projects that are not yet cached.
174
183
/// All requests that return a `EventAction::Accept` i.e. are not rate limited (on
@@ -196,12 +205,13 @@ pub enum RelayCounters {
196
205
/// Counts the number of times Relay started.
197
206
/// This can be used to track unwanted restarts due to crashes or termination.
198
207
ServerStarting ,
199
- /// Counts the number of messages placed on the Kafka queue. When Relay operates with processing
200
- /// enabled and a message is successfully processed each message will generate an event on the
201
- /// Kafka queue and zero or more attachments. The counter has an `event_type` tag which is set to
208
+ /// Counts the number of messages placed on the Kafka queue.
209
+ ///
210
+ /// When Relay operates with processing enabled and an item is successfully processed, each item
211
+ /// will generate a message on the Kafka. The counter has an `event_type` tag which is set to
202
212
/// either `event` or `attachment` representing the type of message produced on the Kafka queue.
203
213
#[ cfg( feature = "processing" ) ]
204
- ProcessingEventProduced ,
214
+ ProcessingMessageProduced ,
205
215
/// Counts the number of events that hit any of the Store like endpoints (Store, Security,
206
216
/// MiniDump, Unreal). The events are counted before they are rate limited , filtered or
207
217
/// processed in any way. The counter has a `version` tag that tracks the message event
@@ -224,18 +234,18 @@ pub enum RelayCounters {
224
234
impl CounterMetric for RelayCounters {
225
235
fn name ( & self ) -> & ' static str {
226
236
match self {
227
- RelayCounters :: EventAccepted => "event.accepted" ,
228
- RelayCounters :: EventRejected => "event.rejected" ,
237
+ RelayCounters :: EnvelopeAccepted => "event.accepted" ,
238
+ RelayCounters :: EnvelopeRejected => "event.rejected" ,
229
239
#[ cfg( feature = "processing" ) ]
230
- RelayCounters :: EventOutcomes => "events.outcomes" ,
240
+ RelayCounters :: Outcomes => "events.outcomes" ,
231
241
RelayCounters :: ProjectStateGet => "project_state.get" ,
232
242
RelayCounters :: ProjectStateRequest => "project_state.request" ,
233
243
RelayCounters :: ProjectCacheHit => "project_cache.hit" ,
234
244
RelayCounters :: ProjectCacheMiss => "project_cache.miss" ,
235
245
RelayCounters :: ProjectIdRequest => "project_id.request" ,
236
246
RelayCounters :: ServerStarting => "server.starting" ,
237
247
#[ cfg( feature = "processing" ) ]
238
- RelayCounters :: ProcessingEventProduced => "processing.event.produced" ,
248
+ RelayCounters :: ProcessingMessageProduced => "processing.event.produced" ,
239
249
RelayCounters :: EventProtocol => "event.protocol" ,
240
250
RelayCounters :: Requests => "requests" ,
241
251
RelayCounters :: ResponsesStatusCodes => "responses.status_codes" ,
0 commit comments