metrics

package
v0.0.0-...-3db709f Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const Namespace = "gitlab_authn"

Variables

This section is empty.

Functions

This section is empty.

Types

type Metrics

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

Metrics is an abstraction over several measurement trackers. Instead of exposing the various counters, gauges, histograms, ... this implementation exposes a simplified API for application specific scenarios.

func New

func New(reg prometheus.Registerer) (*Metrics, error)

New returns a metrics abstraction layer which registers all its internal metrics with the provided prometheus.Registerer. All errors are the result of failed registrations.

func NewDefault

func NewDefault() (*Metrics, error)

NewDefault calls New with prometheus.DefaultRegisterer

func (*Metrics) AuthMalformed

func (m *Metrics) AuthMalformed(realm string)

AuthMalformed tracks a failed authentication due to malformed user input.

func (*Metrics) AuthNotFound

func (m *Metrics) AuthNotFound(realm string)

AuthNotFound tracks a failed authentication due to a lack of account information associated with the user input.

func (*Metrics) AuthSuccess

func (m *Metrics) AuthSuccess(realm string)

AuthSuccess tracks a successful authentication.

func (*Metrics) AuthUnauthorized

func (m *Metrics) AuthUnauthorized(realm string)

AuthUnauthorized tracks a failed authentication due to the user not being authorized to access the provided realm.

func (*Metrics) GitlabRequest

func (m *Metrics) GitlabRequest(service string, elapsed time.Duration)

GitlabRequest reports on the elapsed time for the specific Gitlab service.

Jump to

Keyboard shortcuts

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