Skip to content

Commit

Permalink
Refine event routing and logging in Kubernetes exporter
Browse files Browse the repository at this point in the history
Added new routing logic for events based on severity and reasons, including CrashLoopBackOff, OOMKilled, and probe failures, with targeted receivers like Slack and Opsgenie. Introduced log level configuration for better control over log verbosity. Adjustments ensure more granular control and actionable notifications for critical issues.
  • Loading branch information
ffppa committed Jan 8, 2025
1 parent 01b9ae0 commit 93b7cfe
Showing 1 changed file with 49 additions and 12 deletions.
61 changes: 49 additions & 12 deletions kubernetes_event_exporter/templates/default.tftpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
config:
logLevel: "info"
receivers:
- file:
layout: {}
Expand Down Expand Up @@ -37,18 +38,54 @@ config:
- match:
- receiver: dump
%{ if enable_slack }
- drop:
- namespace: "*test*"
- type: "Normal"
match:
- kind: "Pod|Deployment|ReplicaSet"
receiver: "slack"
- match:
reason:
- Unhealthy
message: ".*CrashLoopBackOff.*|.*OOMKilled.*"
type:
- Warning
- Error
route:
- receiver: opsgenie

- match:
reason:
- Unhealthy
message: ".*Liveness probe failed.*|.*Readiness probe failed.*"
drop: true

- match:
reason:
- Failed
type:
- Warning
- Error
route:
- receiver: "slack"
%{ endif }
%{ if enable_opsgenie }
- drop:
- namespace: "*test*"
- type: "Normal"
match:
- kind: "Pod|Deployment|ReplicaSet"
receiver: "${opsgenie_receiver_name}"
- match:
reason:
- Unhealthy
message: ".*CrashLoopBackOff.*|.*OOMKilled.*"
type:
- Warning
- Error
route:
- receiver: opsgenie

- match:
reason:
- Unhealthy
message: ".*Liveness probe failed.*|.*Readiness probe failed.*"
drop: true

- match:
reason:
- Failed
type:
- Warning
- Error
route:
- receiver: "${opsgenie_receiver_name}"
%{ endif }

0 comments on commit 93b7cfe

Please sign in to comment.