Help us shape the future of Go! Take the 2026 Go Developer Survey

metrics

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package metrics holds the coordinator's Prometheus metrics. They are served on a separate listener (--metrics-listen), never on the public port.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Control plane.
	Registrations = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name: "transporter_registrations_total",
		Help: "Node registrations by result (ok, invalid_key, exhausted, error).",
	}, []string{"result"})
	ControlStreams = prometheus.NewGauge(prometheus.GaugeOpts{
		Name: "transporter_control_streams",
		Help: "Open netmap streams.",
	})
	NetmapsSent = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "transporter_netmaps_sent_total",
		Help: "Netmaps sent to nodes (keepalives excluded).",
	})
	NetmapBytes = prometheus.NewCounter(prometheus.CounterOpts{
		Name: "transporter_netmap_bytes_total",
		Help: "Encoded size of the netmaps sent.",
	})
	SnapshotBuild = prometheus.NewHistogram(prometheus.HistogramOpts{
		Name:    "transporter_snapshot_build_seconds",
		Help:    "Time to rebuild the shared mesh snapshot netmaps are cut from.",
		Buckets: prometheus.ExponentialBuckets(0.0005, 2, 14),
	})

	// HTTP.
	HTTPRequests = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name: "transporter_http_requests_total",
		Help: "HTTP requests by area (api, control, relay, ui) and status class.",
	}, []string{"area", "code"})
)

Registry holds every metric below plus Go runtime and process metrics.

Functions

func Counter

func Counter(name, help string, f func() float64)

Counter registers a counter read at scrape time from a monotonic source.

func Gauge

func Gauge(name, help string, f func() float64)

Gauge registers a gauge computed at scrape time, e.g. node counts.

func Handler

func Handler() http.Handler

Handler serves the metrics in the Prometheus text format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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