Documentation ¶
Overview ¶
package collector implements Prometheus Collectors for the GoatCounter API
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ExporterCollector ¶
type ExporterCollector struct { StartTime *prometheus.Desc BuildInfo *prometheus.Desc // contains filtered or unexported fields }
ExporterCollector collects metrics, mostly runtime, about this exporter in general.
func NewExporterCollector ¶
func NewExporterCollector(osVersion, goVersion, gitCommit string, startTime int64) *ExporterCollector
NewExporterCollector is a function that returns a new ExporterCollector.
func (*ExporterCollector) Collect ¶
func (c *ExporterCollector) Collect(ch chan<- prometheus.Metric)
Collect implements Prometheus' Collector interface and is used to collect metrics
func (*ExporterCollector) Describe ¶
func (c *ExporterCollector) Describe(ch chan<- *prometheus.Desc)
Describe implements Prometheus' Collector interface and is used to describe metrics
type PathsCollector ¶
type PathsCollector struct { Total *prometheus.Desc // contains filtered or unexported fields }
PathsCollector collects metrics on GoatCounter's /paths endpoint
func NewPathsCollector ¶
func NewPathsCollector(client *goatcounter.Client, logger *slog.Logger) *PathsCollector
NewPathsCollector is a function that returns a new PathsCollector
func (*PathsCollector) Collect ¶
func (c *PathsCollector) Collect(ch chan<- prometheus.Metric)
Collect is a method that implements Prometheus' Collector itnerface and is used to collect metrics
func (*PathsCollector) Describe ¶
func (c *PathsCollector) Describe(ch chan<- *prometheus.Desc)
Describe is a method that implements Prometheus' Collector interface and is used to describe metrics
type StatisticsCollector ¶
type StatisticsCollector struct { Total *prometheus.Desc Hits *prometheus.Desc // contains filtered or unexported fields }
StatisticsCollector collects metrics on GoatCounter's /stats endpoint
func NewStatisticsCollector ¶
func NewStatisticsCollector(client *goatcounter.Client, logger *slog.Logger) *StatisticsCollector
NewStatisticsCollector is a function that returns a new StatisticsCollector
func (*StatisticsCollector) Collect ¶
func (c *StatisticsCollector) Collect(ch chan<- prometheus.Metric)
Collect implements Prometheus' Collector interface and is used to collect metrics
func (*StatisticsCollector) Describe ¶
func (c *StatisticsCollector) Describe(ch chan<- *prometheus.Desc)
Describe implements Prometheus' Collector interface and is used to describe metrics