freeleaps-ops/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml
zhenyus 623d504c5c fix: correct indentation for logging configuration in OpenTelemetry YAML
Signed-off-by: zhenyus <zhenyus@mathmast.com>
2025-04-16 06:13:41 +08:00

71 lines
1.9 KiB
YAML

{{- if .Values.logIngest.enabled }}
apiVersion: opentelemetry.io/v1beta1
kind: OpenTelemetryCollector
metadata:
name: {{ .Release.Name }}-opentelemetry-collector
namespace: {{ .Release.Namespace }}
spec:
mode: sidecar
image: ghcr.io/open-telemetry/opentelemetry-collector-releases/opentelemetry-collector-contrib:latest
config:
receivers:
filelog:
include:
- {{ .Values.logIngest.logPathPattern }}
start_at: beginning
include_file_path: true
include_file_name: true
processors:
k8sattributes:
auth_type: "serviceAccount"
passthrough: false
extract:
metadata:
- k8s.pod.name
- k8s.pod.ip
- k8s.pod.uid
- k8s.deployment.name
- 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: service.name
value: "{{ .Release.Name }}"
action: upsert
- key: service.namespace
value: "{{ .Release.Namespace }}"
action: upsert
- key: loki.format
action: insert
value: json
batch:
send_batch_size: 1000
timeout: 10s
exporters:
loki:
endpoint: {{ .Values.logIngest.lokiEndpoint }}
logging:
verbosity: detailed
service:
telemetry:
logs:
level: "info"
pipelines:
logs:
receivers: [filelog]
processors: [k8sattributes, resource, batch]
exporters: [loki, logging]
{{- end }}