Skip to content

Commit

Permalink
Add a metric around the size of each span
Browse files Browse the repository at this point in the history
  • Loading branch information
ayirr7 committed Sep 12, 2024
1 parent 6c680fe commit fa1f7f4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rust_snuba/src/processors/spans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::str::FromStr;

use anyhow::Context;
use chrono::DateTime;
use rust_arroyo::timer;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use uuid::Uuid;
Expand All @@ -22,6 +23,8 @@ pub fn process_message(
let payload_bytes = payload.payload().context("Expected payload")?;
let msg: FromSpanMessage = serde_json::from_slice(payload_bytes)?;

timer!("spans.messages.size", payload_bytes.len() as f64);

let origin_timestamp = DateTime::from_timestamp(msg.received as i64, 0);
let mut span: Span = msg.try_into()?;

Expand Down

0 comments on commit fa1f7f4

Please sign in to comment.