|
1 | 1 | #![warn(clippy::all, rust_2018_idioms)]
|
2 | 2 |
|
3 | 3 | use cargo_registry::{metrics::LogEncoder, util::errors::AppResult, App, Env};
|
4 |
| -use std::{borrow::Cow, fs::File, process::Command, sync::Arc, time::Duration}; |
| 4 | +use std::{fs::File, process::Command, sync::Arc, time::Duration}; |
5 | 5 |
|
6 | 6 | use conduit_hyper::Service;
|
7 | 7 | use futures_util::future::FutureExt;
|
8 | 8 | use prometheus::Encoder;
|
9 | 9 | use reqwest::blocking::Client;
|
10 |
| -use sentry::{ClientOptions, IntoDsn}; |
11 | 10 | use std::io::Write;
|
12 | 11 | use tokio::io::AsyncWriteExt;
|
13 | 12 | use tokio::signal::unix::{signal, SignalKind};
|
14 | 13 |
|
15 | 14 | const CORE_THREADS: usize = 4;
|
16 | 15 |
|
17 | 16 | fn main() -> Result<(), Box<dyn std::error::Error>> {
|
18 |
| - let _sentry = dotenv::var("SENTRY_DSN_API") |
19 |
| - .ok() |
20 |
| - .into_dsn() |
21 |
| - .expect("SENTRY_DSN_API is not a valid Sentry DSN value") |
22 |
| - .map(|dsn| { |
23 |
| - let mut opts = ClientOptions::from(dsn); |
24 |
| - opts.environment = Some( |
25 |
| - dotenv::var("SENTRY_ENV_API") |
26 |
| - .map(Cow::Owned) |
27 |
| - .expect("SENTRY_ENV_API must be set when using SENTRY_DSN_API"), |
28 |
| - ); |
29 |
| - |
30 |
| - opts.release = dotenv::var("HEROKU_SLUG_COMMIT").ok().map(Into::into); |
31 |
| - |
32 |
| - sentry::init(opts) |
33 |
| - }); |
| 17 | + let _sentry = cargo_registry::sentry::init(); |
34 | 18 |
|
35 | 19 | // Initialize logging
|
36 | 20 | tracing_subscriber::fmt::init();
|
|
0 commit comments