Skip to content

Commit 43ac758

Browse files
committed
sentry: Enable tracing feature
1 parent b761ebb commit 43ac758

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

Cargo.lock

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ rand = "0.8"
7474
reqwest = { version = "0.11", features = ["blocking", "gzip", "json"] }
7575
scheduled-thread-pool = "0.2.0"
7676
semver = { version = "1.0.3", features = ["serde"] }
77-
sentry = "0.23.0"
77+
sentry = { version = "0.23.0", features = ["tracing"] }
7878
serde = { version = "1.0.0", features = ["derive"] }
7979
serde_json = "1.0.0"
8080
sha2 = "0.9"

src/bin/server.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use sentry::{ClientOptions, IntoDsn};
1111
use std::io::Write;
1212
use tokio::io::AsyncWriteExt;
1313
use tokio::signal::unix::{signal, SignalKind};
14+
use tracing_subscriber::prelude::*;
1415

1516
const CORE_THREADS: usize = 4;
1617

@@ -33,7 +34,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
3334
});
3435

3536
// Initialize logging
36-
tracing_subscriber::fmt::init();
37+
tracing_subscriber::registry()
38+
.with(tracing_subscriber::fmt::layer())
39+
.with(sentry::integrations::tracing::layer())
40+
.init();
3741

3842
let config = cargo_registry::config::Server::default();
3943
let env = config.env();

0 commit comments

Comments
 (0)