Skip to content

Commit 8bba608

Browse files
committed
optionally send trace spans to sentry for analyzing performance
1 parent c7f7ecc commit 8bba608

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/bin/cratesfyi.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,16 @@ fn main() {
4848
}
4949
}))
5050
.init();
51+
5152
Some(sentry::init((
5253
sentry_dsn,
5354
sentry::ClientOptions {
5455
release: Some(docs_rs::BUILD_VERSION.into()),
5556
attach_stacktrace: true,
57+
traces_sample_rate: env::var("SENTRY_TRACES_SAMPLE_RATE")
58+
.ok()
59+
.and_then(|v| v.parse().ok())
60+
.unwrap_or(0.0),
5661
..Default::default()
5762
}
5863
.add_integration(sentry_panic::PanicIntegration::default()),

0 commit comments

Comments
 (0)