Skip to content

Commit

Permalink
enable manually added timestamp in to_envelope
Browse files Browse the repository at this point in the history
  • Loading branch information
Elias Ram committed May 24, 2024
1 parent b383fb6 commit 493d0ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sentry-core/src/metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,9 @@ impl Metric {

/// Convert the metric into an [`Envelope`] containing a single [`EnvelopeItem::Statsd`].
pub fn to_envelope(self) -> Envelope {
let timestamp = SystemTime::now()
let timestamp = self
.time
.unwrap_or(SystemTime::now())
.duration_since(UNIX_EPOCH)
.unwrap_or_default()
.as_secs();
Expand Down

0 comments on commit 493d0ff

Please sign in to comment.