metrics

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeMetrics

func InitializeMetrics(enableDefaultCollectors bool) (*prometheus.Registry, promauto.Factory)

InitializeMetrics create a custom promauto instance with a local registry to avoid potential conflicts arising from packages using the default promauto registry

func RequestStatus

func RequestStatus(pf promauto.Factory) func(http.Handler) http.Handler

RequestStatus return a http middleware that collects all the incoming http requests and categorize them accoding to their route and response status code

Types

type Metrics

type Metrics interface {
	// Register provides a prometheus factory that can be employed to add custom metrics to the service
	Register(pf promauto.Factory)
}

Metrics is an interface that can be employed when using the service to

define custom metrics that developer can add throughout the service

Jump to

Keyboard shortcuts

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