fix(opentelemetry): update log ingestion settings and enhance transformation logic
Signed-off-by: zhenyus <zhenyus@mathmast.com>
This commit is contained in:
parent
b97d5228d9
commit
19626a44fa
@ -22,10 +22,9 @@ spec:
|
|||||||
include:
|
include:
|
||||||
- {{ .Values.logIngest.logPathPattern }}
|
- {{ .Values.logIngest.logPathPattern }}
|
||||||
start_at: end
|
start_at: end
|
||||||
include_file_path: true
|
include_file_path: false
|
||||||
include_file_name: true
|
include_file_name: false
|
||||||
operators:
|
operators:
|
||||||
# 简单解析JSON,不改变结构
|
|
||||||
- type: json_parser
|
- type: json_parser
|
||||||
- type: remove
|
- type: remove
|
||||||
field: body
|
field: body
|
||||||
@ -55,15 +54,16 @@ spec:
|
|||||||
- from: connection
|
- from: connection
|
||||||
resource:
|
resource:
|
||||||
attributes:
|
attributes:
|
||||||
- key: service.name
|
|
||||||
value: "{{ .Release.Name }}"
|
|
||||||
action: upsert
|
|
||||||
- key: service.namespace
|
|
||||||
value: "{{ .Release.Namespace }}"
|
|
||||||
action: upsert
|
|
||||||
- key: loki.format
|
- key: loki.format
|
||||||
action: insert
|
action: insert
|
||||||
value: json
|
value: json
|
||||||
|
transform:
|
||||||
|
log_statements:
|
||||||
|
- context: log
|
||||||
|
statements:
|
||||||
|
- merge_maps(body, body.attributes)
|
||||||
|
- delete_key(body, "attributes")
|
||||||
|
- delete_key(body, "resources")
|
||||||
batch:
|
batch:
|
||||||
send_batch_size: 1000
|
send_batch_size: 1000
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
@ -79,6 +79,6 @@ spec:
|
|||||||
pipelines:
|
pipelines:
|
||||||
logs:
|
logs:
|
||||||
receivers: [filelog]
|
receivers: [filelog]
|
||||||
processors: [k8sattributes, resource, batch]
|
processors: [k8sattributes, resource, transform, batch]
|
||||||
exporters: [loki]
|
exporters: [loki]
|
||||||
{{- end }}
|
{{- end }}
|
||||||
Loading…
Reference in New Issue
Block a user