Skip to content

Commit

Permalink
ref(normalization): Remove normalization debug metrics (#3786)
Browse files Browse the repository at this point in the history
  • Loading branch information
iambriccardo committed Jul 8, 2024
1 parent ec7ad6b commit e761760
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 60 deletions.
55 changes: 2 additions & 53 deletions relay-server/src/services/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1464,31 +1464,7 @@ impl EnvelopeProcessorService {
&self,
state: &mut ProcessEnvelopeState<G>,
) -> Result<(), ProcessingError> {
let attachment_type = state
.envelope()
.get_item_by(|item| item.attachment_type().is_some())
.and_then(|item| item.attachment_type())
.map(|ty| ty.to_string());
let event_type = state
.event
.value()
.and_then(|e| e.ty.value())
.map(|ty| ty.as_str())
.unwrap_or("none");

if !state.has_event() {
metric!(
counter(RelayCounters::NormalizationDecision) += 1,
event_type = event_type,
attachment_type = attachment_type.as_deref().unwrap_or("none"),
origin = if state.envelope().meta().is_from_internal_relay() {
"internal"
} else {
"external"
},
decision = "no_event"
);

// NOTE(iker): only processing relays create events from
// attachments, so these events won't be normalized in
// non-processing relays even if the config is set to run full
Expand All @@ -1500,39 +1476,12 @@ impl EnvelopeProcessorService {
NormalizationLevel::Full => true,
NormalizationLevel::Default => {
if self.inner.config.processing_enabled() && state.event_fully_normalized {
metric!(
counter(RelayCounters::NormalizationDecision) += 1,
event_type = event_type,
attachment_type = attachment_type.as_deref().unwrap_or("none"),
origin = if state.envelope().meta().is_from_internal_relay() {
"internal"
} else {
"external"
},
decision = "skip_normalized"
);
return Ok(());
} else {
self.inner.config.processing_enabled()
}
}
};

metric!(
counter(RelayCounters::NormalizationDecision) += 1,
event_type = event_type,
attachment_type = attachment_type.as_deref().unwrap_or("none"),
origin = if state.envelope().meta().is_from_internal_relay() {
"internal"
} else {
"external"
},
decision = if full_normalization {
"full_normalization"
} else {
"limited_normalization"
self.inner.config.processing_enabled()
}
);
};

let request_meta = state.managed_envelope.envelope().meta();
let client_ipaddr = request_meta.client_addr().map(IpAddr::from);
Expand Down
7 changes: 0 additions & 7 deletions relay-server/src/statsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -769,12 +769,6 @@ pub enum RelayCounters {
/// The amount of times metrics of a project have been flushed without the project being
/// fetched/available.
ProjectStateFlushMetricsNoProject,
/// The decision on whether normalization should run for an event.
///
/// This metric is tagged with:
/// - `decision`: the decision relay makes on the event.
/// - `attachment_type`: the type of the attachment in the envelope.
NormalizationDecision,
}

impl CounterMetric for RelayCounters {
Expand Down Expand Up @@ -818,7 +812,6 @@ impl CounterMetric for RelayCounters {
RelayCounters::FeedbackAttachments => "processing.feedback_attachments",
RelayCounters::CogsUsage => "cogs.usage",
RelayCounters::ProjectStateFlushMetricsNoProject => "project_state.metrics.no_project",
RelayCounters::NormalizationDecision => "normalization.decision",
}
}
}
Expand Down

0 comments on commit e761760

Please sign in to comment.