-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add overdue scheduled publishing metric
This is a replacement for the old overdue scheduled publishing alert in Icinga
- Loading branch information
1 parent
fd0c4a4
commit 4c4bb33
Showing
2 changed files
with
17 additions
and
1 deletion.
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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
require "govuk_app_config/govuk_prometheus_exporter" | ||
GovukPrometheusExporter.configure | ||
require "collectors/scheduled_publishing_overdue_collector" | ||
|
||
GovukPrometheusExporter.configure(collectors: [Collectors::ScheduledPublishingOverdueCollector]) |
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,14 @@ | ||
module Collectors | ||
class ScheduledPublishingOverdueCollector < PrometheusExporter::Server::CollectorBase | ||
def type | ||
"whitehall" | ||
end | ||
|
||
def metrics | ||
whitehall_scheduled_publishing_overdue = PrometheusExporter::Metric::Gauge.new("whitehall_scheduled_publishing_overdue", "Overdue scheduled publications") | ||
whitehall_scheduled_publishing_overdue.observe(Edition.due_for_publication.count) | ||
|
||
[whitehall_scheduled_publishing_overdue] | ||
end | ||
end | ||
end |