-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
metrics.go
51 lines (44 loc) · 1.33 KB
/
metrics.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (c) Liam Stanley <me@liamstanley.io>. All rights reserved. Use
// of this source code is governed by the MIT license that can be found in
// the LICENSE file.
package metrics
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var (
AuthCount = promauto.NewCounter(
prometheus.CounterOpts{
Name: "spectrograph_auth_count_total",
Help: "The total number of authentications",
},
)
WorkerGuildCount = promauto.NewGaugeVec(
prometheus.GaugeOpts{
Name: "spectrograph_worker_guild_count",
Help: "The number of guilds the worker is currently in",
},
[]string{"shard_id"},
)
WorkerEventCount = promauto.NewCounterVec(
prometheus.CounterOpts{
Name: "spectrograph_worker_event_count_total",
Help: "The total number of worker events",
},
[]string{"shard_id", "event_type", "guild_id"},
)
WorkerSessionsRemainingCount = promauto.NewGaugeVec(
prometheus.GaugeOpts{
Name: "spectrograph_worker_sessions_remaining_count",
Help: "The number of sessions remaining for a worker",
},
[]string{"shard_id"},
)
WorkerSessionsTotalCount = promauto.NewGaugeVec(
prometheus.GaugeOpts{
Name: "spectrograph_worker_sessions_total_count",
Help: "The number of total sessions allowed for this shard ID",
},
[]string{"shard_id"},
)
)