mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-09 16:50:01 +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)"`
|
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"`
|
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"`
|
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"`
|
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"`
|
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)"`
|
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 cfg.SentryDSN != "" {
|
||||||
if err := sentry.Init(sentry.ClientOptions{
|
if err := sentry.Init(sentry.ClientOptions{
|
||||||
Dsn: cfg.SentryDSN,
|
Dsn: cfg.SentryDSN,
|
||||||
Release: strings.Join([]string{"twitch-bot", version}, "@"),
|
Environment: cfg.SentryEnvironment,
|
||||||
|
Release: strings.Join([]string{"twitch-bot", version}, "@"),
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return errors.Wrap(err, "initializing sentry sdk")
|
return errors.Wrap(err, "initializing sentry sdk")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue