-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add sentry configuration and injection point (#271)
* chore: add sentry configuration and injection point * wip: move invocation to prod config * wip: change to error level logs
- Loading branch information
Showing
4 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import Config | ||
|
||
is_prod? = config_env() == :prod | ||
is_release? = not is_nil(System.get_env("RELEASE_MODE")) | ||
|
||
if is_prod? and is_release? do | ||
sentry_env = System.get_env("SENTRY_ENV") | ||
|
||
if not is_nil(sentry_env) do | ||
config :sentry, | ||
dsn: System.fetch_env!("SENTRY_DSN"), | ||
environment_name: sentry_env, | ||
enable_source_code_context: true, | ||
root_source_code_path: File.cwd!(), | ||
tags: %{ | ||
env: sentry_env | ||
}, | ||
included_environments: [sentry_env] | ||
|
||
config :logger, Sentry.LoggerBackend, | ||
level: :error, | ||
capture_log_messages: true | ||
end | ||
end |
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