Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
noisyscanner committed Oct 22, 2024
1 parent 64cda3e commit a37aeef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions metrics/src/logprocessor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ async fn handle_websocket_log(log: &BaseLog, metric_obj: &Telemetry) {
}

pub async fn log_processor(logline: &String, metric_obj: &Telemetry, tracer: &trace::Tracer) {
println!("{}", logline); // TODO: strip blank lines?
println!("{}", logline);
metric_obj.LOG_LINES_COUNTER_TOTAL.inc();
let log_result = from_str::<BaseLog>(logline);
match log_result {
Expand All @@ -206,11 +206,11 @@ pub async fn log_processor(logline: &String, metric_obj: &Telemetry, tracer: &tr
}
_ => {}
};

//Send log to opentel:
// tracer.in_span("hasura-log", |cx| {
// let span = cx.span();
// span.add_event(
// span.add_event(
// logline.clone(),
// vec![],
// );
Expand Down
2 changes: 1 addition & 1 deletion metrics/src/logreceiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async fn receive_log(
rt::spawn(async move {
while let Some(msg) = stream.next().await {
if let Ok(Message::Text(text)) = msg {
let _ = logprocessor::log_processor(&text.to_string().trim(), &metric_obj, &tracer).await;
let _ = logprocessor::log_processor(&text.trim().to_string(), &metric_obj, &tracer).await;
session.text("{\"success\": true}").await.unwrap();
}
// TODO: log if failed
Expand Down

0 comments on commit a37aeef

Please sign in to comment.