simplify: remove ParseJSON operations from OpenTelemetry transform

- Remove complex JSON parsing operations that may cause issues
- Keep only essential resource attribute mapping
- This should help logs be properly processed and sent to Loki
This commit is contained in:
Nicolas 2025-09-22 20:22:40 +08:00
parent a9d3930ba3
commit b60c5c9324

View File

@ -86,16 +86,6 @@ spec:
- set(resource.attributes["kubernetes_node_name"], resource.attributes["k8s.node.name"]) - set(resource.attributes["kubernetes_node_name"], resource.attributes["k8s.node.name"])
- set(resource.attributes["kubernetes_deployment_name"], resource.attributes["k8s.deployment.name"]) - set(resource.attributes["kubernetes_deployment_name"], resource.attributes["k8s.deployment.name"])
- set(resource.attributes["kubernetes_namespace"], resource.attributes["k8s.namespace.name"]) - set(resource.attributes["kubernetes_namespace"], resource.attributes["k8s.namespace.name"])
- set(resource.attributes["body_json"], ParseJSON(log.body))
- set(resource.attributes["body_json"]["kubernetes"]["pod"], resource.attributes["k8s.pod.name"])
- set(resource.attributes["body_json"]["kubernetes"]["namespace"], resource.attributes["k8s.namespace.name"])
- set(resource.attributes["body_json"]["kubernetes"]["pod_ip"], resource.attributes["k8s.pod.ip"])
- set(resource.attributes["body_json"]["kubernetes"]["pod_uid"], resource.attributes["k8s.pod.uid"])
- set(resource.attributes["body_json"]["kubernetes"]["deployment"], resource.attributes["k8s.deployment.name"])
- set(resource.attributes["body_json"]["kubernetes"]["node"], resource.attributes["k8s.node.name"])
- set(resource.attributes["body_json"]["kubernetes"]["namespace"], resource.attributes["k8s.namespace.name"])
- set(log.body, resource.attributes["body_json"])
- delete_key(resource.attributes, "body_json")
batch: batch:
send_batch_size: 5 send_batch_size: 5
timeout: 10s timeout: 10s