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
Click to show internal directories.
Click to hide internal directories.