Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add flag that relay processed an event #279

Merged
merged 1 commit into from
Oct 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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