fix(opentelemetry): refine log processing by removing unnecessary fields and enhancing attribute insertion
Signed-off-by: zhenyus <zhenyus@mathmast.com>
This commit is contained in:
parent
90b4b3bb9b
commit
544293f7b2
@ -26,11 +26,11 @@ spec:
|
||||
include_file_name: false
|
||||
operators:
|
||||
- type: json_parser
|
||||
- type: remove
|
||||
field: body
|
||||
parse_from: body
|
||||
parse_to: attributes
|
||||
processors:
|
||||
k8sattributes:
|
||||
auth_type: "serviceAccount"
|
||||
auth_type: serviceAccount
|
||||
wait_for_metadata: true
|
||||
wait_for_metadata_timeout: 10s
|
||||
passthrough: false
|
||||
@ -43,27 +43,29 @@ spec:
|
||||
- k8s.deployment.uid
|
||||
- k8s.namespace.name
|
||||
- k8s.node.name
|
||||
pod_association:
|
||||
- sources:
|
||||
- from: resource_attribute
|
||||
name: k8s.pod.ip
|
||||
- sources:
|
||||
- from: resource_attribute
|
||||
name: k8s.pod.uid
|
||||
- sources:
|
||||
- from: connection
|
||||
resource:
|
||||
attributes:
|
||||
- key: loki.format
|
||||
action: insert
|
||||
value: json
|
||||
transform:
|
||||
log_statements:
|
||||
- context: log
|
||||
statements:
|
||||
- set(body, body.attributes)
|
||||
- delete_key(body, "attributes")
|
||||
- delete_key(body, "resources")
|
||||
attributes/k8s:
|
||||
actions:
|
||||
- action: insert
|
||||
key: kubernetes.pod_name
|
||||
from_attribute: k8s.pod.name
|
||||
- action: insert
|
||||
key: kubernetes.pod_ip
|
||||
from_attribute: k8s.pod.ip
|
||||
- action: insert
|
||||
key: kubernetes.pod_uid
|
||||
from_attribute: k8s.pod.uid
|
||||
- action: insert
|
||||
key: kubernetes.deployment_name
|
||||
from_attribute: k8s.deployment.name
|
||||
- action: insert
|
||||
key: kubernetes.deployment_uid
|
||||
from_attribute: k8s.deployment.uid
|
||||
- action: insert
|
||||
key: kubernetes.namespace_name
|
||||
from_attribute: k8s.namespace.name
|
||||
- action: insert
|
||||
key: kubernetes.node_name
|
||||
from_attribute: k8s.node.name
|
||||
batch:
|
||||
send_batch_size: 1000
|
||||
timeout: 10s
|
||||
@ -73,12 +75,9 @@ spec:
|
||||
tls:
|
||||
insecure: true
|
||||
service:
|
||||
telemetry:
|
||||
logs:
|
||||
level: "info"
|
||||
pipelines:
|
||||
logs:
|
||||
receivers: [filelog]
|
||||
processors: [k8sattributes, resource, transform, batch]
|
||||
processors: [k8sattributes, attributes/k8s, batch]
|
||||
exporters: [loki]
|
||||
{{- end }}
|
||||
Loading…
Reference in New Issue
Block a user