metrics

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ScrapeErrors = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name:      "scrape_errors_total",
		Namespace: "adguard",
		Help:      "The number of errors scraping a target",
	}, []string{"server"})

	// Status
	ProtectionEnabled = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name:      "protection_enabled",
		Namespace: "adguard",
		Help:      "Whether DNS filtering is enabled",
	}, []string{"server"})
	Running = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name:      "running",
		Namespace: "adguard",
		Help:      "Whether adguard is running or not",
	}, []string{"server", "version"})

	// Stats
	TotalQueries = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name:      "queries",
		Namespace: "adguard",
		Help:      "Total queries processed in the last 24 hours",
	}, []string{"server"})
	BlockedFiltered = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name:      "queries_blocked",
		Namespace: "adguard",
		Help:      "Total queries that have been blocked from filter lists",
	}, []string{"server"})
	ReplacedSafesearch = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name:      "replaced_safesearch",
		Namespace: "adguard",
		Help:      "Total queries that have been replaced due to safesearch",
	}, []string{"server"})
	ReplacedSafebrowsing = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name:      "replaced_safebrowsing",
		Namespace: "adguard",
		Help:      "Total queries that have been replaced due to safebrowsing",
	}, []string{"server"})
	ReplacedParental = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name:      "replaced_parental",
		Namespace: "adguard",
		Help:      "Total queries that have been replaced due to parental",
	}, []string{"server"})
	AvgProcessingTime = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name:      "avg_processing_time_seconds",
		Namespace: "adguard",
		Help:      "The average query processing time in seconds",
	}, []string{"server"})
	ProcessingTimeBucketMilli = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Name:      "processing_time_milliseconds",
		Namespace: "adguard",
		Help:      "The processing time of queries (deprecated, use processing_time_seconds)",
	}, []string{"server", "client", "upstream"})
	ProcessingTimeBucket = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Name:      "processing_time_seconds",
		Namespace: "adguard",
		Help:      "The processing time of queries",
	}, []string{"server", "client", "upstream"})
	TopQueriedDomains = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name:      "top_queried_domains",
		Namespace: "adguard",
		Help:      "The number of queries for the top domains",
	}, []string{"server", "domain"})
	TopBlockedDomains = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name:      "top_blocked_domains",
		Namespace: "adguard",
		Help:      "The number of blocked queries for the top domains",
	}, []string{"server", "domain"})
	TopClients = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name:      "top_clients",
		Namespace: "adguard",
		Help:      "The number of queries for the top clients",
	}, []string{"server", "client"})
	TopUpstreams = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name:      "top_upstreams",
		Namespace: "adguard",
		Help:      "The number of repsonses for the top upstream servers",
	}, []string{"server", "upstream"})
	TopUpstreamsAvgTimes = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name:      "top_upstreams_avg_response_time_seconds",
		Namespace: "adguard",
		Help:      "The average response time for each of the top upstream servers",
	}, []string{"server", "upstream"})
	QueryTypes = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name:      "query_types",
		Namespace: "adguard",
		Help:      "The number of queries for a specific type",
	}, []string{"server", "type", "client"})
	TotalQueriesDetails = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name:      "queries_details",
		Namespace: "adguard",
		Help:      "Total queries by user",
	}, []string{"server", "user", "reason", "status", "upstream", "client_name"})
	TotalQueriesDetailsHistogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Name:      "queries_details_histogram",
		Namespace: "adguard",
		Help:      "Total queries by user",
		Buckets:   prometheus.LinearBuckets(0, 10, 10),
	}, []string{"server", "user", "reason", "status", "upstream", "client_name"})

	// DHCP
	DhcpEnabled = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Name:      "dhcp_enabled",
		Namespace: "adguard",
		Help:      "Whether dhcp is enabled",
	}, []string{"server"})
	DhcpLeasesMetric = prometheus.NewDesc(
		"adguard_dhcp_leases",
		"The dhcp leases",
		[]string{"server", "type", "ip", "mac", "hostname", "expires_at"},
		nil,
	)
	DhcpLeases = NewDhcpLeasesServer(DhcpLeasesMetric)
)

Functions

func Init

func Init()

Types

type DhcpLeasesServer added in v1.0.3

type DhcpLeasesServer struct {
	Desc *prometheus.Desc
	// contains filtered or unexported fields
}

func NewDhcpLeasesServer added in v1.0.3

func NewDhcpLeasesServer(desc *prometheus.Desc) *DhcpLeasesServer

func (*DhcpLeasesServer) Collect added in v1.0.3

func (d *DhcpLeasesServer) Collect(ch chan<- prometheus.Metric)

func (*DhcpLeasesServer) Describe added in v1.0.3

func (d *DhcpLeasesServer) Describe(ch chan<- *prometheus.Desc)

func (*DhcpLeasesServer) Record added in v1.0.3

func (d *DhcpLeasesServer) Record(server string, leases []adguard.DhcpLease)

Jump to

Keyboard shortcuts

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