metrics

package
v4.36.4 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Prometheus

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

Prometheus is a middleware for recording prometheus metrics.

func NewPrometheus

func NewPrometheus() (provider *Prometheus)

NewPrometheus returns a new Prometheus metrics recorder.

func (*Prometheus) RecordAuthentication

func (r *Prometheus) RecordAuthentication(success, banned bool, authType string)

RecordAuthentication takes the success and regulated booleans and a method string to record the authentication metrics.

func (*Prometheus) RecordAuthenticationDuration

func (r *Prometheus) RecordAuthenticationDuration(success bool, elapsed time.Duration)

RecordAuthenticationDuration takes the statusCode string, requestMethod string, and the elapsed time.Duration to record the request and request duration metrics.

func (*Prometheus) RecordRequest

func (r *Prometheus) RecordRequest(statusCode, requestMethod string, elapsed time.Duration)

RecordRequest takes the statusCode string, requestMethod string, and the elapsed time.Duration to record the request and request duration metrics.

func (*Prometheus) RecordVerifyRequest

func (r *Prometheus) RecordVerifyRequest(statusCode string)

RecordVerifyRequest takes the statusCode string to record the verify endpoint request metrics.

type Provider

type Provider interface {
	Recorder
	regulation.MetricsRecorder
}

Provider implementation.

type Recorder

type Recorder interface {
	RecordRequest(statusCode, requestMethod string, elapsed time.Duration)
	RecordVerifyRequest(statusCode string)
	RecordAuthenticationDuration(success bool, elapsed time.Duration)
}

Recorder of metrics.

Jump to

Keyboard shortcuts

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