Skip to content

Commit

Permalink
add ParseBool for env var
Browse files Browse the repository at this point in the history
  • Loading branch information
chaudharysaket committed Sep 12, 2024
1 parent 2081151 commit b521ab8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,11 @@ func ConfigurationFromEnvironment() *Configuration {
collectTraceIDStr, collectTraceIDOverride := os.LookupEnv("NEW_RELIC_COLLECT_TRACE_ID")

extensionEnabled := true
if nrEnabledOverride && strings.ToLower(nrEnabledStr) == "false" {
extensionEnabled = false
if nrEnabledOverride {
b, err := strconv.ParseBool(nrEnabledStr)
if err == nil && !b {
extensionEnabled = false
}
}
if nrEnabledRubyOverride && strings.ToLower(nrEnabledRubyStr) == "false" {
extensionEnabled = false
Expand Down

0 comments on commit b521ab8

Please sign in to comment.