Skip to content

Commit fd07319

Browse files
author
Khue Duong
committed
fix: add OTEL environment variables to helm chart and addDEFAULT_LOGGING_CONFIG_DICT
1 parent 4d2d2af commit fd07319

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

charts/gitops/templates/deployment.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,33 @@ spec:
7070
secretKeyRef:
7171
name: {{ .Release.Name }}-secret
7272
key: GITHUB_WEBHOOK_KEY
73+
- name: NODE_IP
74+
valueFrom:
75+
fieldRef:
76+
fieldPath: status.hostIP
77+
- name: OTEL_EXPORTER_OTLP_ENDPOINT
78+
value: "http://$(NODE_IP):4317"
79+
- name: OTEL_PYTHON_LOG_CORRELATION
80+
value: "True"
81+
- name: OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED
82+
value: "True"
83+
- name: OTEL_LOGS_EXPORTER
84+
value: "otlp"
85+
- name: OTEL_METRICS_EXPORTER
86+
value: "none"
87+
- name: OTEL_TRACES_EXPORTER
88+
value: "otlp"
89+
- name: OTEL_SERVICE_NAME
90+
value: "gitops"
91+
- name: OTEL_EXPORTER_OTLP_TIMEOUT
92+
value: "1"
93+
- name: OTEL_RESOURCE_ATTRIBUTES:
94+
value: "cluster={{.Values.cluster}}"
95+
# We want to limit the length of the attributes so that we don't store too much
96+
- name: OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT
97+
value: "512"
98+
- name: OTEL_PYTHON_EXCLUDED_URLS
99+
value: "pingz,livez,readyz,metrics,robots.txt,favicon.ico"
73100
volumeMounts:
74101
- name: git-crypt-key
75102
mountPath: "/etc/gitops"

gitops_server/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from gitops_server.app import app
1616
from gitops_server.workers import DeployQueueWorker
1717

18+
LOGGING = DEFAULT_LOGGING_CONFIG_DICT
1819
manually_instrument_logging()
1920
manually_instrument_fastapi()
2021

0 commit comments

Comments
 (0)