Skip to content

Commit 493d0ff

Browse files
author
Elias Ram
committed
enable manually added timestamp in to_envelope
1 parent b383fb6 commit 493d0ff

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sentry-core/src/metrics/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,9 @@ impl Metric {
526526

527527
/// Convert the metric into an [`Envelope`] containing a single [`EnvelopeItem::Statsd`].
528528
pub fn to_envelope(self) -> Envelope {
529-
let timestamp = SystemTime::now()
529+
let timestamp = self
530+
.time
531+
.unwrap_or(SystemTime::now())
530532
.duration_since(UNIX_EPOCH)
531533
.unwrap_or_default()
532534
.as_secs();

0 commit comments

Comments
 (0)