Skip to content

Commit c7795f9

Browse files
committed
Enhancement: Re-design alerts
Alerts used to be linked to a logstream and were based on an expression based logic With this PR, alerts will be independent of logstreams and will be based on a SQL query The given threshold config will get evaluated against the result of the query and the target config will be used to send out notifications
1 parent 82a09eb commit c7795f9

File tree

24 files changed

+1169
-668
lines changed

24 files changed

+1169
-668
lines changed

src/alerts/mod.rs

Lines changed: 0 additions & 281 deletions
This file was deleted.

src/event/mod.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ use arrow_array::RecordBatch;
2424
use arrow_schema::{Field, Fields, Schema};
2525
use itertools::Itertools;
2626
use std::sync::Arc;
27-
use tracing::error;
2827

2928
use self::error::EventError;
3029
pub use self::writer::STREAM_WRITERS;
@@ -90,12 +89,6 @@ impl Event {
9089

9190
crate::livetail::LIVETAIL.process(&self.stream_name, &self.rb);
9291

93-
if let Err(e) = metadata::STREAM_INFO
94-
.check_alerts(&self.stream_name, &self.rb)
95-
.await
96-
{
97-
error!("Error checking for alerts. {:?}", e);
98-
}
9992

10093
Ok(())
10194
}

src/handlers/airplane.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ impl FlightService for AirServiceImpl {
157157
.ok_or_else(|| Status::aborted("Malformed SQL Provided, Table Name Not Found"))?
158158
.to_owned();
159159

160-
update_schema_when_distributed(streams)
160+
update_schema_when_distributed(&streams)
161161
.await
162162
.map_err(|err| Status::internal(err.to_string()))?;
163163

@@ -212,7 +212,7 @@ impl FlightService for AirServiceImpl {
212212

213213
let permissions = Users.get_permissions(&key);
214214

215-
authorize_and_set_filter_tags(&mut query, permissions, &stream_name).map_err(|_| {
215+
authorize_and_set_filter_tags(&mut query, permissions, &streams).map_err(|_| {
216216
Status::permission_denied("User Does not have permission to access this")
217217
})?;
218218
let time = Instant::now();

0 commit comments

Comments
 (0)