File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import (
1717 "k8s.io/apimachinery/pkg/api/resource"
1818 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1919 "k8s.io/apimachinery/pkg/runtime"
20+ "k8s.io/utils/pointer"
2021 "k8s.io/utils/ptr"
2122 ctrl "sigs.k8s.io/controller-runtime"
2223 "sigs.k8s.io/controller-runtime/pkg/client"
@@ -305,6 +306,7 @@ func prometheusRuleToCoralogixAlertSpec(rule prometheus.Rule) coralogixv1alpha1.
305306 Notifications : []coralogixv1alpha1.Notification {
306307 {
307308 RetriggeringPeriodMinutes : getNotificationPeriod (rule ),
309+ IntegrationName : getNotificationIntegrationName (rule ),
308310 },
309311 },
310312 },
@@ -363,6 +365,14 @@ func getNotificationPeriod(rule prometheus.Rule) int32 {
363365 return defaultCoralogixNotificationPeriod
364366}
365367
368+ func getNotificationIntegrationName (rule prometheus.Rule ) * string {
369+ if integrationName , ok := rule .Annotations ["cxNotificationName" ]; ok {
370+ return pointer .String (integrationName )
371+ }
372+
373+ return nil
374+ }
375+
366376var prometheusAlertForToCoralogixPromqlAlertTimeWindow = map [prometheus.Duration ]coralogixv1alpha1.MetricTimeWindow {
367377 "1m" : coralogixv1alpha1 .MetricTimeWindow (coralogixv1alpha1 .TimeWindowMinute ),
368378 "5m" : coralogixv1alpha1 .MetricTimeWindow (coralogixv1alpha1 .TimeWindowFiveMinutes ),
You can’t perform that action at this time.
0 commit comments