Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
**Bug Fixes**:

- Use sentry prefix for browser name/version in logs. ([#4783](https://github.com/getsentry/relay/pull/4783))
- Do not overcount the number of bytes in logs. ([#4786](https://github.com/getsentry/relay/pull/4786))

**Internal**:

Expand Down
41 changes: 21 additions & 20 deletions relay-server/src/services/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,7 @@ impl StoreService {
}
};

let num_logs = logs.items.len() as u32;
for log in logs.items {
let timestamp_seconds = log.timestamp as i64;
let timestamp_nanos = (log.timestamp.fract() * 1e9) as u32;
Expand Down Expand Up @@ -1060,28 +1061,28 @@ impl StoreService {
};

self.produce(KafkaTopic::Items, message)?;

// We need to track the count and bytes separately for possible rate limits and quotas on both counts and bytes.
self.outcome_aggregator.send(TrackOutcome {
category: DataCategory::LogItem,
event_id: None,
outcome: Outcome::Accepted,
quantity: 1,
remote_addr: None,
scoping,
timestamp: received_at,
});
self.outcome_aggregator.send(TrackOutcome {
category: DataCategory::LogByte,
event_id: None,
outcome: Outcome::Accepted,
quantity: payload.len() as u32,
remote_addr: None,
scoping,
timestamp: received_at,
});
}

// We need to track the count and bytes separately for possible rate limits and quotas on both counts and bytes.
self.outcome_aggregator.send(TrackOutcome {
category: DataCategory::LogItem,
event_id: None,
outcome: Outcome::Accepted,
quantity: num_logs,
remote_addr: None,
scoping,
timestamp: received_at,
});
self.outcome_aggregator.send(TrackOutcome {
category: DataCategory::LogByte,
event_id: None,
outcome: Outcome::Accepted,
quantity: payload.len() as u32,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

payload is the container here for anyone wondering why we have to do this

remote_addr: None,
scoping,
timestamp: received_at,
});

Ok(())
}

Expand Down