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

metrics

package
v0.16.0 Latest Latest
Warning

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

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

Documentation

Overview

Package metrics serves an optional Prometheus text exposition at GET /metrics. No Prometheus client library: counters and gauges are written by hand.

Index

Constants

View Source
const ContentType = "text/plain; version=0.0.4; charset=utf-8"

ContentType is the Prometheus text 0.0.4 media type.

Variables

This section is empty.

Functions

func Handler

func Handler(token string, httpm *HTTP, q *jobs.Queue, st *settings.Store, dataDir string) http.HandlerFunc

Handler serves Prometheus text. token empty = open (network trust, like /healthz).

Types

type HTTP

type HTTP struct {
	// contains filtered or unexported fields
}

HTTP holds process-lifetime request counters by status class.

func (*HTTP) Middleware

func (h *HTTP) Middleware(next http.Handler) http.Handler

Middleware records one request per response by HTTP status class.

Jump to

Keyboard shortcuts

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