Documentation ¶
Overview ¶
Package monitor provides implementations for monitoring statistics and exposing them as Prometheus metrics.
Index ¶
- func GuildsGauge(config *Config) prometheus.Gauge
- func MembersGauge(config *Config) prometheus.Gauge
- func ReadyCounter(config *Config) prometheus.Counter
- func VoiceStateUpdateCounter(config *Config) prometheus.Counter
- type Config
- type Guilds
- type GuildsCache
- type Members
- type MembersCache
- type Metrics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GuildsGauge ¶
func GuildsGauge(config *Config) prometheus.Gauge
GuildsGauge returns a Prometheus gauge for the number of guilds the bot belongs to.
func MembersGauge ¶
func MembersGauge(config *Config) prometheus.Gauge
MembersGauge returns a Prometheus gauge for the number of members of the guilds the bot belongs to.
func ReadyCounter ¶
func ReadyCounter(config *Config) prometheus.Counter
ReadyCounter returns a Prometheus counter for Ready events.
func VoiceStateUpdateCounter ¶
func VoiceStateUpdateCounter(config *Config) prometheus.Counter
VoiceStateUpdateCounter returns a Prometheus counter for VoiceStateUpdate events.
Types ¶
type Guilds ¶
type Guilds struct { Log logging.Interface Session *discordgo.Session Interval time.Duration PrometheusGauge prometheus.Gauge Cache *GuildsCache }
Guilds contains fields for monitoring the guilds the bot belongs to.
type GuildsCache ¶
GuildsCache is an in-memory cache of the guilds the bot belongs to.
type Members ¶
type Members struct { Log logging.Interface Session *discordgo.Session Interval time.Duration PrometheusGauge prometheus.Gauge Cache *MembersCache }
Members contains fields for monitoring the number of members in the guilds the bot belongs to.
type MembersCache ¶
MembersCache is an in-memory cache of the number of members in the guilds the bot belongs to.
type Metrics ¶
type Metrics struct { *Config Guilds *Guilds Members *Members ReadyCounter prometheus.Counter VoiceStateUpdateCounter prometheus.Counter GuildsGauge prometheus.Gauge MembersGauge prometheus.Gauge }
Metrics contains fields for tracking and exposing metrics to Prometheus.
func NewMetrics ¶
NewMetrics returns a new *Metrics configured using the provided config.