mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-12-20 11:51:17 +00:00
[core] Add Sentry-Environment configuration
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
fbfcb959c0
commit
6970069778
1 changed files with 4 additions and 2 deletions
6
main.go
6
main.go
|
@ -48,6 +48,7 @@ var (
|
|||
LogLevel string `flag:"log-level" default:"info" description:"Log level (debug, info, warn, error, fatal)"`
|
||||
PluginDir string `flag:"plugin-dir" default:"/usr/lib/twitch-bot" description:"Where to find and load plugins"`
|
||||
SentryDSN string `flag:"sentry-dsn" default:"" description:"Sentry / GlitchTip DSN for error reporting"`
|
||||
SentryEnvironment string `flag:"sentry-environment" default:"" description:"Environment to submit to Sentry to distinguish bot instances"`
|
||||
StorageConnString string `flag:"storage-conn-string" default:"./storage.db" description:"Connection string for the database"`
|
||||
StorageConnType string `flag:"storage-conn-type" default:"sqlite" description:"One of: mysql, postgres, sqlite"`
|
||||
StorageEncryptionPass string `flag:"storage-encryption-pass" default:"" description:"Passphrase to encrypt secrets inside storage (defaults to twitch-client:twitch-client-secret)"`
|
||||
|
@ -97,8 +98,9 @@ func initApp() error {
|
|||
|
||||
if cfg.SentryDSN != "" {
|
||||
if err := sentry.Init(sentry.ClientOptions{
|
||||
Dsn: cfg.SentryDSN,
|
||||
Release: strings.Join([]string{"twitch-bot", version}, "@"),
|
||||
Dsn: cfg.SentryDSN,
|
||||
Environment: cfg.SentryEnvironment,
|
||||
Release: strings.Join([]string{"twitch-bot", version}, "@"),
|
||||
}); err != nil {
|
||||
return errors.Wrap(err, "initializing sentry sdk")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue