fix: remove problematic ParseJSON operations from OpenTelemetry transform processor

This commit is contained in:
Nicolas 2025-07-29 14:30:00 +08:00
parent 22ab4b99ef
commit aa8e626b7a

View File

@ -78,6 +78,17 @@ spec:
- action: insert
key: k8s.deployment.name
value: ${KUBE_META_OBJECT_NAME}
transform:
log_statements:
- context: log
statements:
- set(resource.attributes["application"], log.attributes["context"]["app"])
- set(resource.attributes["environment"], log.attributes["context"]["env"])
- set(resource.attributes["kubernetes_node_name"], resource.attributes["k8s.node.name"])
- set(resource.attributes["kubernetes_pod_name"], resource.attributes["k8s.pod.name"])
- set(resource.attributes["kubernetes_pod_ip"], resource.attributes["k8s.pod.ip"])
- set(resource.attributes["kubernetes_deployment_name"], resource.attributes["k8s.deployment.name"])
- set(resource.attributes["kubernetes_namespace"], resource.attributes["k8s.namespace.name"])
batch:
send_batch_size: 5
timeout: 10s
@ -93,6 +104,6 @@ spec:
pipelines:
logs:
receivers: [filelog]
processors: [resource, batch]
processors: [resource, transform, batch]
exporters: [otlphttp/logs]
{{- end }}