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 - action: insert
key: kubernetes.node_name key: kubernetes.node_name
from_attribute: k8s.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: transform:
log_statements: log_statements:
- context: log - context: log
@ -77,16 +85,17 @@ spec:
send_batch_size: 5 send_batch_size: 5
timeout: 10s timeout: 10s
exporters: exporters:
otlphttp: # otlphttp/logs:
endpoint: {{ .Values.logIngest.lokiEndpoint }}/otlp # endpoint: {{ .Values.logIngest.lokiEndpoint }}/otlp
tls: # tls:
insecure: true # insecure: true
loki
debug: debug:
verbosity: detailed verbosity: detailed
service: service:
pipelines: pipelines:
logs: logs:
receivers: [filelog] receivers: [filelog]
processors: [k8sattributes, attributes/k8s, transform, batch] processors: [k8sattributes, attributes/k8s, attributes/labeling, transform, batch]
exporters: [otlphttp, debug] exporters: [otlphttp/logs, debug]
{{- end }} {{- end }}