metrics

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package metrics is a small set of counters and gauges written in the Prometheus text exposition format: what the sidecar and the read gateway count, including the metering counters billing reads (docs/backend.md).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Set

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

Set holds metrics by name and label set.

func New

func New() *Set

New returns an empty set.

func (*Set) Add

func (s *Set) Add(name string, v float64, kv ...string)

Add adds v to a declared metric's series named by label pairs.

func (*Set) Counter

func (s *Set) Counter(name, help string)

Counter declares a counter.

func (*Set) Gauge

func (s *Set) Gauge(name, help string)

Gauge declares a gauge.

func (*Set) Get

func (s *Set) Get(name string, kv ...string) float64

Get reads a series: tests and the gateway's own accounting.

func (*Set) ServeHTTP

func (s *Set) ServeHTTP(w http.ResponseWriter, _ *http.Request)

ServeHTTP serves the set at /metrics.

func (*Set) Set

func (s *Set) Set(name string, v float64, kv ...string)

Set sets a gauge's series.

func (*Set) WriteTo

func (s *Set) WriteTo(w io.Writer) (int64, error)

WriteTo writes every metric in the text format, in name order.

Jump to

Keyboard shortcuts

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