Skip to content

Commit

Permalink
Merge pull request #9 from blackbx/start-without-newrelic-licence
Browse files Browse the repository at this point in the history
Add the ability to start the application with out a NewRelic licence key
  • Loading branch information
alistairjudson committed Feb 6, 2020
2 parents d3de26e + 0dc46be commit ace462d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions newrelic/newrelic.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ var Service = dependency.Service{
}

// NewApp will create a new instance of the *newrelic.Application
func NewApp(config dependency.ConfigGetter, logger *zap.Logger) (*newrelic.Application, error) {
func NewApp(config dependency.ConfigGetter, logger *zap.Logger) (app *newrelic.Application, err error) {
key := config.GetString("newrelic-license-key")
if key == "" {
return app, nil
}
return newrelic.NewApplication(
newrelic.ConfigAppName(config.GetString("newrelic-app-name")),
newrelic.ConfigLicense(config.GetString("newrelic-license-key")),
newrelic.ConfigLicense(key),
newrelic.ConfigDistributedTracerEnabled(config.GetBool("newrelic-distributed-tracer-enabled")),
nrzap.ConfigLogger(logger),
)
Expand Down

0 comments on commit ace462d

Please sign in to comment.