metrics

package
v0.0.0-...-a2f44c0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Requests = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: fmt.Sprintf("%s_requests", metricsAppName),
			Help: "Count of requests by handlers",
		},
		[]string{"handler"},
	)
	ResponseTime = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Name:    fmt.Sprintf("%s_response_time", metricsAppName),
			Help:    "Response time of requests",
			Buckets: []float64{0.1, 0.5, 1, 2, 5},
		},
		[]string{"handler"},
	)
	StatusCodes = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: fmt.Sprintf("%s_status_codes", metricsAppName),
			Help: "Handlers not successful status codes",
		},
		[]string{"handler", "status_code"},
	)
)

Functions

func Init

func Init()

func Run

func Run(ctx context.Context, port string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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