-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #87 from Overmuse/SR/sentry
feat: Add sentry integration
- Loading branch information
Showing
5 changed files
with
233 additions
and
8 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
use anyhow::Result; | ||
use order_manager::run; | ||
use order_manager::Settings; | ||
use tracing::subscriber::set_global_default; | ||
use tracing_subscriber::EnvFilter; | ||
use sentry::{ClientOptions, IntoDsn}; | ||
use tracing_subscriber::prelude::*; | ||
|
||
#[tokio::main] | ||
async fn main() -> Result<()> { | ||
dotenv::dotenv().ok(); | ||
let subscriber = tracing_subscriber::fmt() | ||
.json() | ||
.with_env_filter(EnvFilter::from_default_env()) | ||
.finish(); | ||
set_global_default(subscriber)?; | ||
let settings = Settings::new()?; | ||
let _guard = sentry::init(ClientOptions { | ||
dsn: settings.sentry.dsn.clone().into_dsn().unwrap(), | ||
environment: Some(settings.sentry.environment.clone().into()), | ||
release: sentry::release_name!(), | ||
..ClientOptions::default() | ||
}); | ||
|
||
tracing_subscriber::registry() | ||
.with(tracing_subscriber::fmt::layer().json()) | ||
.with(sentry_tracing::layer()) | ||
.init(); | ||
run(settings).await | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters