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:
parent
fb0c828156
commit
61e3f5caff
@ -25,8 +25,8 @@ spec:
|
|||||||
include_file_path: true
|
include_file_path: true
|
||||||
include_file_name: true
|
include_file_name: true
|
||||||
operators:
|
operators:
|
||||||
|
# 简单解析JSON,不改变结构
|
||||||
- type: json_parser
|
- type: json_parser
|
||||||
id: json_parser
|
|
||||||
processors:
|
processors:
|
||||||
k8sattributes:
|
k8sattributes:
|
||||||
auth_type: "serviceAccount"
|
auth_type: "serviceAccount"
|
||||||
@ -60,11 +60,14 @@ spec:
|
|||||||
- key: loki.format
|
- key: loki.format
|
||||||
action: insert
|
action: insert
|
||||||
value: json
|
value: json
|
||||||
|
# 使用transform将k8s和资源属性添加到原始JSON中
|
||||||
transform:
|
transform:
|
||||||
log_statements:
|
log_statements:
|
||||||
- context: log
|
- context: log
|
||||||
statements:
|
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:
|
batch:
|
||||||
send_batch_size: 1000
|
send_batch_size: 1000
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
@ -73,6 +76,7 @@ spec:
|
|||||||
endpoint: {{ .Values.logIngest.lokiEndpoint }}
|
endpoint: {{ .Values.logIngest.lokiEndpoint }}
|
||||||
tls:
|
tls:
|
||||||
insecure: true
|
insecure: true
|
||||||
|
format: json
|
||||||
debug:
|
debug:
|
||||||
verbosity: detailed
|
verbosity: detailed
|
||||||
service:
|
service:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user