From 69700697789b07d28cc7fb0facc0c58280f4a131 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Wed, 20 Mar 2024 12:01:41 +0100 Subject: [PATCH] [core] Add Sentry-Environment configuration Signed-off-by: Knut Ahlers --- main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 547c105..9aea2f2 100644 --- a/main.go +++ b/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") }