metrics

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricHTTPRequests = "ploykit_http_requests"

	MetricHTTPDurationSeconds = "ploykit_http_request_duration_seconds"
)

Variables

View Source
var DefaultDurationBuckets = []float64{0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10}

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled *bool

	Path string

	Token string
}

type Mount

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

func NewMount

func NewMount(cfg Config, opts ...Option) *Mount

func (*Mount) Handler

func (m *Mount) Handler() http.Handler

func (*Mount) Middleware

func (m *Mount) Middleware(next http.Handler) http.Handler

func (*Mount) Path

func (m *Mount) Path() string

func (*Mount) Registry

func (m *Mount) Registry() *Registry

type Option

type Option func(*config)

func WithHistogramBuckets

func WithHistogramBuckets(name string, buckets []float64) Option

func WithRegistry

func WithRegistry(r *Registry) Option

type Registry

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

func New

func New(opts ...Option) *Registry

func (*Registry) Add

func (r *Registry) Add(name string, delta int64)

func (*Registry) Counter

func (r *Registry) Counter(name string) *atomic.Int64

func (*Registry) Gauge

func (r *Registry) Gauge(name string, v float64)

func (*Registry) Handler

func (r *Registry) Handler() http.Handler

func (*Registry) HandlerWithToken

func (r *Registry) HandlerWithToken(token string) http.Handler

func (*Registry) Incr

func (r *Registry) Incr(name string)

func (*Registry) IncrAttrs

func (r *Registry) IncrAttrs(name string, attrs map[string]string)

func (*Registry) InstallGlobal

func (r *Registry) InstallGlobal()

func (*Registry) Observe

func (r *Registry) Observe(name string, v float64)

func (*Registry) ObserveAttrs

func (r *Registry) ObserveAttrs(name string, v float64, attrs map[string]string)

func (*Registry) Snapshot

func (r *Registry) Snapshot() map[string]int64

Jump to

Keyboard shortcuts

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