Skip to content

Commit

Permalink
feat: moved entity synthesis labels to helpers file
Browse files Browse the repository at this point in the history
  • Loading branch information
rohit-bandlamudi-nr committed Dec 18, 2024
1 parent 15c4614 commit 6c3ebf5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 9 additions & 0 deletions charts/newrelic-logging/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,15 @@ https://log-api.newrelic.com/log/v1
{{- end -}}
{{- end -}}


{{/*
Create labels required for entity synthesis to be put as part of prometheus_remote_write configuration
*/}}
{{- define "newrelic-logging.entitySynthesis.labels" -}}
{{- printf "add_label namespace %s" .Release.Namespace | nindent 8 -}}
{{- printf "add_label helm_release_name %s" .Release.Name | nindent 8 -}}
{{- end -}}

{{/*
Returns metricsHost
*/}}
Expand Down
5 changes: 2 additions & 3 deletions charts/newrelic-logging/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ data:
{{- .Values.fluentBit.config.extraOutputs | nindent 4}}
{{- end }}
{{- if and (.Values.fluentBit.sendMetrics) (.Values.fluentBit.config.metricInstrumentation) }}
{{- .Values.fluentBit.config.metricInstrumentation | nindent 4}}
{{ printf "add_label namespace %s" .Release.Namespace | nindent 8}}
{{ printf "add_label helm_release_name %s" .Release.Name | nindent 8}}
{{- .Values.fluentBit.config.metricInstrumentation | nindent 4 -}}
{{ include "newrelic-logging.entitySynthesis.labels" . }}
{{- end }}
parsers.conf: |
{{- if .Values.fluentBit.config.parsers }}
Expand Down

0 comments on commit 6c3ebf5

Please sign in to comment.