Skip to content

Commit

Permalink
New Relic Labels
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-lozoya committed Apr 3, 2024
1 parent 6fa4d51 commit eb6e5af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/constants/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ const (

EnvNewRelicAppName = "NEW_RELIC_APP_NAME"
EnvNewRelicLicenseKey = "NEW_RELIC_LICENSE_KEY"
EnvNewRelicLabels = "NEW_RELIC_LABELS"
)
7 changes: 7 additions & 0 deletions pkg/instrumentation/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,13 @@ func (i *sdkInjector) injectNewrelicConfig(ctx context.Context, newrelic v1alpha
},
})
}
idx = getIndexOfEnv(container.Env, constants.EnvNewRelicLabels)
if idx == -1 {
container.Env = append(container.Env, corev1.EnvVar{
Name: "NEW_RELIC_LABELS",
Value: "operator:auto-injection",
})
}
return pod
}

Expand Down

0 comments on commit eb6e5af

Please sign in to comment.