Skip to content

Commit

Permalink
fix: Add flag that relay processed an event (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
untitaker committed Oct 28, 2019
1 parent be02c0e commit 2eace10
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions server/src/actors/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use semaphore_general::filter::FilterStatKey;
use semaphore_general::pii::PiiProcessor;
use semaphore_general::processor::{process_value, ProcessingState};
use semaphore_general::protocol::{Event, EventId};
use semaphore_general::types::{Annotated, ProcessingAction};
use semaphore_general::types::{Annotated, ProcessingAction, Value};
use serde_json;

use crate::actors::controller::{Controller, Shutdown, Subscribe, TimeoutError};
Expand Down Expand Up @@ -188,7 +188,7 @@ impl EventProcessor {

// Event filters assume a normalized event. Unfortunately, this requires us to run
// expensive normalization first.
if let Some(event) = event.value() {
if let Some(event) = event.value_mut() {
let client_ip = message.meta.client_addr();
let filter_settings = &message.project_state.config.filter_settings;
let filter_result = metric! {timer("event_processing.filtering"), {
Expand All @@ -199,6 +199,11 @@ impl EventProcessor {
// If the event should be filtered, no more processing is needed
return Ok(ProcessEventResponse::Filtered { reason });
}

event.other.insert(
"_relay_processed".to_owned(),
Annotated::new(Value::Bool(false)),
);
}
}
}
Expand Down

0 comments on commit 2eace10

Please sign in to comment.