Skip to content

Commit

Permalink
chore: Add Hostname to Bugsnag Configuration (#327)
Browse files Browse the repository at this point in the history
* add CDN host name

* add hostnamr

* rename

* address feedback
  • Loading branch information
aarthykc authored Mar 8, 2022
1 parent 4c8a5d9 commit 6f49ed5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions nconf/bugsnag.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ type BugSnagConfig struct {
Environment string
APIKey string `envconfig:"api_key" json:"api_key" yaml:"api_key"`
ProjectPackage string `envconfig:"project_package" json:"project_package" yaml:"project_package"`
NodeName string `envconfig:"node_name" json:"node_name" yaml:"node_name"` // If left unset, bugsnag will default to the value returned by os.Hostname
}

func SetupBugSnag(config *BugSnagConfig, version string) error {
Expand All @@ -24,6 +25,7 @@ func SetupBugSnag(config *BugSnagConfig, version string) error {
bugsnag.Configure(bugsnag.Configuration{
APIKey: config.APIKey,
ReleaseStage: config.Environment,
Hostname: config.NodeName,
AppVersion: version,
ProjectPackages: projectPackages,
PanicHandler: func() {}, // this is to disable panic handling. The lib was forking and restarting the process (causing races)
Expand Down

0 comments on commit 6f49ed5

Please sign in to comment.