[core] Add Sentry-Environment configuration

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2024-03-20 12:01:41 +01:00
parent fbfcb959c0
commit 6970069778
Signed by: luzifer
SSH key fingerprint: SHA256:/xtE5lCgiRDQr8SLxHMS92ZBlACmATUmF1crK16Ks4E

View file

@ -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)"`
@ -98,6 +99,7 @@ func initApp() error {
if cfg.SentryDSN != "" {
if err := sentry.Init(sentry.ClientOptions{
Dsn: cfg.SentryDSN,
Environment: cfg.SentryEnvironment,
Release: strings.Join([]string{"twitch-bot", version}, "@"),
}); err != nil {
return errors.Wrap(err, "initializing sentry sdk")