-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add prometheus alerts in support bundle #94
Conversation
5380bd3
to
924ca40
Compare
ad5ffec
to
d245802
Compare
@@ -209,6 +213,50 @@ func (m *SupportBundleManager) phaseCollectClusterBundle() error { | |||
return nil | |||
} | |||
|
|||
func (m *SupportBundleManager) phaseCollectPrometheusBundle() error { | |||
pods, err := m.k8s.GetPodsListByLabels("cattle-monitoring-system", "app.kubernetes.io/name=prometheus") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@c3y1huang Any objection to this feature? this feature adds a phase and checks as if the cluster has a Prometheus pod (especially run in the cattle-monitoring-system ns). If yes, it will try to extract the current alerts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No objections since it's non-blocking (optionalPhase). Additionally, Longhorn could potentially benefit from this.
d108fcc
to
dbe6231
Compare
Signed-off-by: Jack Yu <jack.yu@suse.com>
Signed-off-by: Jack Yu <jack.yu@suse.com>
Related Issue
harvester/harvester#4993
Solution
For the first version of this feature, focus on fetching current alert.
I think If we fetch too many alerts here, it might be a problem for us debugging because it's too much and not easy to be queried. So, I just fetch current alert and format it.
Test Plan
Case 1. Generate support bundle without enabling rancher-monitoring, it should succeed as well, excluding
prometheus-alerts.json
.Case 2. Generate support bundle with enable rancher-monitoring, there should be a file called
prometheus-alerts.json
in first layer of directory.Result
Sample, it only shows pending and firing state alert