metrics

package
v0.0.0-...-d3d41f9 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package metrics implements a very opinionated take on metrics.

Please consider this more like an example rather than a standard to follow.

Index

Constants

View Source
const (
	UomMicroseconds = "us"
)

Variables

View Source
var BucketsRequestDuration = []float64{
	0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1.0, 2.5, 5.0, 10.0, 30.0, 60.0,
}

Functions

This section is empty.

Types

type MetricsServer

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

func New

func New(name, addr string) (metricsServer *MetricsServer, err error)

func (*MetricsServer) Float64Histogram

func (ms *MetricsServer) Float64Histogram(
	name string,
	description string,
	uom string,
	bucketBounds ...float64,
) metric.Float64Histogram

Float64Histogram returns a float64 histogram with given name and parameters.

Once created it's cached and reused further on. All subsequent calls to this method that use the same name will retrieve already created histogram from the cache.

It is thread-safe.

See also: https://pkg.go.dev/go.opentelemetry.io/otel/metric@v1.21.0#Meter.Float64Histogram

func (*MetricsServer) ListenAndServe

func (ms *MetricsServer) ListenAndServe() error

func (*MetricsServer) Shutdown

func (ms *MetricsServer) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the server without interrupting any active connections.

Jump to

Keyboard shortcuts

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