Skip to content

Commit 093e86b

Browse files
committed
make fmt
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent 7e5b4cc commit 093e86b

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

coderd/notifications/metrics.go

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,26 @@ const (
2828

2929
func NewMetrics(reg prometheus.Registerer) *Metrics {
3030
return &Metrics{
31-
DispatchedCount: promauto.With(reg).NewCounterVec(prometheus.CounterOpts{Name: "dispatched_count", Namespace: ns, Subsystem: subsystem,
31+
DispatchedCount: promauto.With(reg).NewCounterVec(prometheus.CounterOpts{
32+
Name: "dispatched_count", Namespace: ns, Subsystem: subsystem,
3233
Help: "The count of notifications successfully dispatched.",
3334
}, []string{LabelMethod, LabelTemplateID}),
34-
TempFailureCount: promauto.With(reg).NewCounterVec(prometheus.CounterOpts{Name: "temporary_failures_count", Namespace: ns, Subsystem: subsystem,
35+
TempFailureCount: promauto.With(reg).NewCounterVec(prometheus.CounterOpts{
36+
Name: "temporary_failures_count", Namespace: ns, Subsystem: subsystem,
3537
Help: "The count of notifications which failed but have retry attempts remaining.",
3638
}, []string{LabelMethod, LabelTemplateID}),
37-
PermFailureCount: promauto.With(reg).NewCounterVec(prometheus.CounterOpts{Name: "permanent_failures_count", Namespace: ns, Subsystem: subsystem,
39+
PermFailureCount: promauto.With(reg).NewCounterVec(prometheus.CounterOpts{
40+
Name: "permanent_failures_count", Namespace: ns, Subsystem: subsystem,
3841
Help: "The count of notifications which failed and have exceeded their retry attempts.",
3942
}, []string{LabelMethod, LabelTemplateID}),
40-
RetryCount: promauto.With(reg).NewCounterVec(prometheus.CounterOpts{Name: "retry_count", Namespace: ns, Subsystem: subsystem,
43+
RetryCount: promauto.With(reg).NewCounterVec(prometheus.CounterOpts{
44+
Name: "retry_count", Namespace: ns, Subsystem: subsystem,
4145
Help: "The count of notification dispatch retry attempts.",
4246
}, []string{LabelMethod, LabelTemplateID}),
4347

4448
// Aggregating on LabelTemplateID as well would cause a cardinality explosion.
45-
QueuedSeconds: promauto.With(reg).NewHistogramVec(prometheus.HistogramOpts{Name: "queued_seconds", Namespace: ns, Subsystem: subsystem,
49+
QueuedSeconds: promauto.With(reg).NewHistogramVec(prometheus.HistogramOpts{
50+
Name: "queued_seconds", Namespace: ns, Subsystem: subsystem,
4651
Buckets: []float64{0.1, 1, 5, 15, 30, 60, 120, 300, 600, 3600, 86400},
4752
Help: "The time elapsed between a notification being enqueued in the store and retrieved for processing " +
4853
"(measures the latency of the notifications system). This should generally be within CODER_NOTIFICATIONS_FETCH_INTERVAL " +
@@ -51,13 +56,15 @@ func NewMetrics(reg prometheus.Registerer) *Metrics {
5156
}, []string{LabelMethod}),
5257

5358
// Aggregating on LabelTemplateID as well would cause a cardinality explosion.
54-
DispatcherSendSeconds: promauto.With(reg).NewHistogramVec(prometheus.HistogramOpts{Name: "dispatcher_send_seconds", Namespace: ns, Subsystem: subsystem,
59+
DispatcherSendSeconds: promauto.With(reg).NewHistogramVec(prometheus.HistogramOpts{
60+
Name: "dispatcher_send_seconds", Namespace: ns, Subsystem: subsystem,
5561
Buckets: []float64{0.001, 0.05, 0.1, 0.5, 1, 2, 5, 10, 15, 30, 60, 120},
5662
Help: "The time taken to dispatch notifications.",
5763
}, []string{LabelMethod}),
5864

5965
// Currently no requirement to discriminate between success and failure updates which are pending.
60-
PendingUpdates: promauto.With(reg).NewGauge(prometheus.GaugeOpts{Name: "pending_updates", Namespace: ns, Subsystem: subsystem,
66+
PendingUpdates: promauto.With(reg).NewGauge(prometheus.GaugeOpts{
67+
Name: "pending_updates", Namespace: ns, Subsystem: subsystem,
6168
Help: "The number of updates waiting to be flushed to the store.",
6269
}),
6370
}

0 commit comments

Comments
 (0)