Skip to content

Commit

Permalink
feat(agent): add configurable logging format (#1536)
Browse files Browse the repository at this point in the history
Co-authored-by: David Ragot <[email protected]>
  • Loading branch information
Dav-14 and David Ragot committed May 24, 2024
1 parent bb23227 commit 1d7c51a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
5 changes: 5 additions & 0 deletions ee/agent/.earthly/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
global:
monitoring:
logs:
format: ""

image:
pullPolicy: Always

Expand Down
7 changes: 7 additions & 0 deletions ee/agent/helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,10 @@ Selector labels
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{- define "agent.monitoring.logs" -}}
{{- if eq .Values.global.monitoring.logs.format "json" }}
- name: JSON_FORMATTING_LOGGER
value: "true"
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions ee/agent/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ spec:
value: "{{ .Values.agent.baseUrl }}"
- name: PRODUCTION
value: "{{ .Values.agent.production }}"
{{- include "agent.monitoring.logs" . | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
Expand Down
20 changes: 13 additions & 7 deletions ee/agent/helm/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
global:
# This is not a global value shared over all charts, but a global value shared over all templates in this chart.
serviceName: agent
monitoring:
logs:
# format:Enum:{json, ""}
format: json

image:
repository: ghcr.io/formancehq/agent
Expand All @@ -20,7 +25,8 @@ podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000

securityContext: {}
securityContext:
{}
# capabilities:
# drop:
# - ALL
Expand All @@ -29,12 +35,12 @@ securityContext: {}
# runAsUser: 1000

resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi

nodeSelector: {}

Expand Down

0 comments on commit 1d7c51a

Please sign in to comment.