Skip to content

Commit

Permalink
[RHCLOUD-23259] Update sentry-dsn to glitchtip-dsn (RedHatInsights#101)
Browse files Browse the repository at this point in the history
* Update sentry-dsn to glitchtip-dsn

* add default value

* fix line

* Make sure log messages are clear that we are using glitchtip dsn
  • Loading branch information
abaiken authored Apr 4, 2023
1 parent c3375de commit 4e7168c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 7 additions & 3 deletions deployment/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ objects:
secretKeyRef:
key: aws_access_key_id
name: cloudwatch
- name: SENTRY_DSN
- name: GLITCHTIP_DSN
valueFrom:
secretKeyRef:
key: sentry-dsn
name: entitlements-secret
name: ${GLITCHTIP_SECRET}
key: dsn
optional: true
envFrom:
- secretRef:
Expand Down Expand Up @@ -196,3 +196,7 @@ parameters:
name: ENTITLE_ALL
required: false
value: 'false'
- description: The name of the Glitchtip secret
name: GLITCHTIP_SECRET
required: false
value: 'entitlements-secret'
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ func main() {
// Init the logger first thing
logger.InitLogger()

var dsn string = os.Getenv("SENTRY_DSN")
var dsn string = os.Getenv("GLITCHTIP_DSN")

if dsn != "" {
err := sentry.Init(sentry.ClientOptions{})
if err != nil {
logger.Log.WithFields(logrus.Fields{"error": err}).Error("Error loading Sentry SDK")
logger.Log.WithFields(logrus.Fields{"error": err}).Error("Error loading Sentry SDK with GLITCHTIP_DSN")
} else {
logger.Log.Info("Sentry SDK initialization was successful!")
logger.Log.Info("Sentry SDK initialization using Glitchtip was successful!")
}
} else {
logger.Log.Info("SENTRY_DSN was not set, skipping Sentry initialization.")
logger.Log.Info("GLITCHTIP_DSN was not set, skipping Glitchtip initialization.")
}

// init config here
Expand Down

0 comments on commit 4e7168c

Please sign in to comment.