fix: add missing id field to json_parser operator and update transform statements in OpenTelemetry configuration

Signed-off-by: zhenyus <zhenyus@mathmast.com>
This commit is contained in:
zhenyus 2025-04-16 07:17:23 +08:00
parent fb0c828156
commit 61e3f5caff

View File

@ -25,8 +25,8 @@ spec:
include_file_path: true
include_file_name: true
operators:
# 简单解析JSON不改变结构
- type: json_parser
id: json_parser
processors:
k8sattributes:
auth_type: "serviceAccount"
@ -60,11 +60,14 @@ spec:
- key: loki.format
action: insert
value: json
# 使用transform将k8s和资源属性添加到原始JSON中
transform:
log_statements:
- context: log
statements:
- merge_maps(attributes, resource.attributes)
- set(body["k8s"], resource.attributes["k8s.pod.name"])
- set(body["service"], resource.attributes["service.name"])
- set(body["namespace"], resource.attributes["service.namespace"])
batch:
send_batch_size: 1000
timeout: 10s
@ -73,6 +76,7 @@ spec:
endpoint: {{ .Values.logIngest.lokiEndpoint }}
tls:
insecure: true
format: json
debug:
verbosity: detailed
service: