Skip to content

Commit

Permalink
ref(cogs): Tag processing time by processing function (#3107)
Browse files Browse the repository at this point in the history
Moves the envelope processing timer to the actual processing of each
group.
  • Loading branch information
Dav1dde committed Feb 14, 2024
1 parent 26edcb1 commit 01c7b2a
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion relay-server/src/services/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,23 @@ impl ProcessingGroup {

grouped_envelopes
}

/// Returns the name of the group.
pub fn variant(&self) -> &'static str {
match self {
ProcessingGroup::Transaction(_) => "transaction",
ProcessingGroup::Error(_) => "error",
ProcessingGroup::Session(_) => "session",
ProcessingGroup::Standalone(_) => "standalone",
ProcessingGroup::ClientReport(_) => "client_report",
ProcessingGroup::Replay(_) => "replay",
ProcessingGroup::CheckIn(_) => "check_in",
ProcessingGroup::Span(_) => "span",
ProcessingGroup::Metrics(_) => "metrics",
ProcessingGroup::ForwardUnknown(_) => "forward_unknown",
ProcessingGroup::Ungrouped(_) => "ungrouped",
}
}
}

/// An error returned when handling [`ProcessEnvelope`].
Expand Down Expand Up @@ -1512,7 +1529,8 @@ impl EnvelopeProcessorService {
let wait_time = message.envelope.start_time().elapsed();
metric!(timer(RelayTimers::EnvelopeWaitTime) = wait_time);

let result = metric!(timer(RelayTimers::EnvelopeProcessingTime), {
let group = message.envelope.group().variant();
let result = metric!(timer(RelayTimers::EnvelopeProcessingTime), group = group, {
self.process(message)
});
match result {
Expand Down

0 comments on commit 01c7b2a

Please sign in to comment.