metrics

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: BSD-3-Clause Imports: 1 Imported by: 25

Documentation

Overview

Package metrics contains expvar & Prometheus types and code used by Tailscale for monitoring.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LabelMap

type LabelMap struct {
	Label string
	expvar.Map
}

LabelMap is a string-to-Var map variable that satisfies the expvar.Var interface.

Semantically, this is mapped by tsweb's Prometheus exporter as a collection of variables with the same name, with a varying label value. Use this to export things that are intuitively breakdowns into different buckets.

func (*LabelMap) Get

func (m *LabelMap) Get(key string) *expvar.Int

Get returns a direct pointer to the expvar.Int for key, creating it if necessary.

func (*LabelMap) GetFloat added in v1.0.0

func (m *LabelMap) GetFloat(key string) *expvar.Float

GetFloat returns a direct pointer to the expvar.Float for key, creating it if necessary.

type Set

type Set struct {
	expvar.Map
}

Set is a string-to-Var map variable that satisfies the expvar.Var interface.

Semantically, this is mapped by tsweb's Prometheus exporter as a collection of unrelated variables exported with a common prefix.

This lets us have tsweb recognize *expvar.Map for different purposes in the future. (Or perhaps all uses of expvar.Map will require explicit types like this one, declaring how we want tsweb to export it to Prometheus.)

Jump to

Keyboard shortcuts

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