fix: optimize central storage logging configuration to resolve hourly log bursts
- Change start_at from beginning to end to avoid historical log duplication - Add poll_interval: 1s for real-time file monitoring - Optimize batch processing: send_batch_size: 1, timeout: 1s - Add PVC template for log persistence to reduce log loss risk - Update deployment to support persistent volume for logs
This commit is contained in:
parent
309bd6ff7c
commit
7a7fcf1398
@ -114,5 +114,10 @@ spec:
|
|||||||
{{- if .Values.logIngest.enabled }}
|
{{- if .Values.logIngest.enabled }}
|
||||||
volumes:
|
volumes:
|
||||||
- name: app-logs
|
- name: app-logs
|
||||||
|
{{- if .Values.logIngest.persistence.enabled }}
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ .Release.Name }}-logs-pvc
|
||||||
|
{{- else }}
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
@ -46,7 +46,8 @@ spec:
|
|||||||
filelog:
|
filelog:
|
||||||
include:
|
include:
|
||||||
- {{ .Values.logIngest.logPathPattern }}
|
- {{ .Values.logIngest.logPathPattern }}
|
||||||
start_at: beginning
|
start_at: end
|
||||||
|
poll_interval: 1s
|
||||||
include_file_path: false
|
include_file_path: false
|
||||||
include_file_name: false
|
include_file_name: false
|
||||||
operators:
|
operators:
|
||||||
@ -96,8 +97,8 @@ spec:
|
|||||||
- set(log.body, resource.attributes["body_json"])
|
- set(log.body, resource.attributes["body_json"])
|
||||||
- delete_key(resource.attributes, "body_json")
|
- delete_key(resource.attributes, "body_json")
|
||||||
batch:
|
batch:
|
||||||
send_batch_size: 5
|
send_batch_size: 1
|
||||||
timeout: 10s
|
timeout: 1s
|
||||||
exporters:
|
exporters:
|
||||||
otlphttp/logs:
|
otlphttp/logs:
|
||||||
endpoint: {{ .Values.logIngest.lokiEndpoint }}/otlp
|
endpoint: {{ .Values.logIngest.lokiEndpoint }}/otlp
|
||||||
|
|||||||
@ -0,0 +1,19 @@
|
|||||||
|
{{- if and .Values.logIngest.enabled .Values.logIngest.persistence.enabled }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-logs-pvc
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: "central-storage"
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.logIngest.persistence.size | default "1Gi" }}
|
||||||
|
{{- if .Values.logIngest.persistence.storageClass }}
|
||||||
|
storageClassName: {{ .Values.logIngest.persistence.storageClass }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
Loading…
Reference in New Issue
Block a user