From 44e12132534e5d056b055fbe4cc4e7ea41dec298 Mon Sep 17 00:00:00 2001 From: zhenyus Date: Mon, 21 Apr 2025 15:59:59 +0800 Subject: [PATCH] fix(opentelemetry): add labeling attributes for app and environment context Signed-off-by: zhenyus --- .../authentication/opentelemetry.yaml | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml b/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml index 49bdb85e..a9324723 100644 --- a/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml +++ b/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml @@ -66,6 +66,14 @@ spec: - action: insert key: kubernetes.node_name from_attribute: k8s.node.name + attributes/labeling: + actions: + - action: insert + key: app + from_attribute: context.app + - action: insert + key: environment + from_attribute: context.env transform: log_statements: - context: log @@ -77,16 +85,17 @@ spec: send_batch_size: 5 timeout: 10s exporters: - otlphttp: - endpoint: {{ .Values.logIngest.lokiEndpoint }}/otlp - tls: - insecure: true + # otlphttp/logs: + # endpoint: {{ .Values.logIngest.lokiEndpoint }}/otlp + # tls: + # insecure: true + loki debug: verbosity: detailed service: pipelines: logs: receivers: [filelog] - processors: [k8sattributes, attributes/k8s, transform, batch] - exporters: [otlphttp, debug] + processors: [k8sattributes, attributes/k8s, attributes/labeling, transform, batch] + exporters: [otlphttp/logs, debug] {{- end }} \ No newline at end of file