-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from avi-biton/monitoring
chore(RHTAPWATCH-1207):Add metrics for total and failed notifications
- Loading branch information
Showing
4 changed files
with
223 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package controller | ||
|
||
import ( | ||
"github.com/prometheus/client_golang/prometheus" | ||
"sigs.k8s.io/controller-runtime/pkg/metrics" | ||
) | ||
|
||
var ( | ||
notifications = prometheus.NewCounter( | ||
prometheus.CounterOpts{ | ||
Name: "notification_controller_notifications_total", | ||
Help: "Number of total notification actions", | ||
}, | ||
) | ||
notificationsFailures = prometheus.NewCounter( | ||
prometheus.CounterOpts{ | ||
Name: "notification_controller_notifications_failures_total", | ||
Help: "Number of failed notifications", | ||
}, | ||
) | ||
) | ||
|
||
func init() { | ||
// Register custom metrics with the global prometheus registry | ||
metrics.Registry.MustRegister(notifications, notificationsFailures) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.