fix(opentelemetry): add labeling attributes for app and environment context

Signed-off-by: zhenyus <zhenyus@mathmast.com>
This commit is contained in:
zhenyus 2025-04-21 15:59:59 +08:00
parent 884a535dd5
commit 44e1213253

View File

@ -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 }}