metrics

package
v4.38.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 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) 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) RecordAuthn added in v4.38.0

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

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

func (*Prometheus) RecordAuthz added in v4.38.0

func (r *Prometheus) RecordAuthz(statusCode string)

RecordAuthz takes the statusCode string to record the verify endpoint request 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) RecordRequestOpenIDConnect added in v4.38.0

func (r *Prometheus) RecordRequestOpenIDConnect(endpoint, statusCode string, elapsed time.Duration)

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

type Provider

type Provider interface {
	Recorder
	regulation.MetricsRecorder
}

Provider implementation.

type Recorder

type Recorder interface {
	RecordRequest(statusCode, requestMethod string, elapsed time.Duration)
	RecordRequestOpenIDConnect(endpoint, statusCode string, elapsed time.Duration)
	RecordAuthz(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