collector

package
v0.0.0-...-a0a094e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

package collector implements Prometheus Collectors for the GoatCounter API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFQName

func BuildFQName(name string, logger *slog.Logger) string

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL