Skip to content

Commit 913b7b3

Browse files
author
Prashant Balachandran
authored
collecting logs if certain alerts are raised (#579)
1 parent e5d29be commit 913b7b3

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

pkg/gatherers/conditional/conditional_gatherer.go

+51
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,57 @@ var defaultGatheringRules = []GatheringRule{
172172
},
173173
},
174174
},
175+
{
176+
Conditions: []ConditionWithParams{
177+
{
178+
Type: AlertIsFiring,
179+
Alert: &AlertConditionParams{
180+
Name: "AlertmanagerFailedReload",
181+
},
182+
},
183+
},
184+
GatheringFunctions: GatheringFunctions{
185+
GatherContainersLogs: GatherContainersLogsParams{
186+
AlertName: "AlertmanagerFailedReload",
187+
Container: "alertmanager",
188+
TailLines: 50,
189+
},
190+
},
191+
},
192+
{
193+
Conditions: []ConditionWithParams{
194+
{
195+
Type: AlertIsFiring,
196+
Alert: &AlertConditionParams{
197+
Name: "PrometheusTargetSyncFailure",
198+
},
199+
},
200+
},
201+
GatheringFunctions: GatheringFunctions{
202+
GatherContainersLogs: GatherContainersLogsParams{
203+
AlertName: "PrometheusTargetSyncFailure",
204+
Container: "prometheus",
205+
TailLines: 50,
206+
},
207+
},
208+
},
209+
{
210+
Conditions: []ConditionWithParams{
211+
{
212+
Type: AlertIsFiring,
213+
Alert: &AlertConditionParams{
214+
Name: "ThanosRuleQueueIsDroppingAlerts",
215+
},
216+
},
217+
},
218+
GatheringFunctions: GatheringFunctions{
219+
GatherContainersLogs: GatherContainersLogsParams{
220+
AlertName: "ThanosRuleQueueIsDroppingAlerts",
221+
Container: "thanos-ruler",
222+
TailLines: 50,
223+
},
224+
},
225+
},
175226
}
176227

177228
// Gatherer implements the conditional gatherer

0 commit comments

Comments
 (0)