metrics

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 0 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package metrics defines the counters IAM emits.

Recorder takes a fixed, low-cardinality set of events, so adding an event in a later version does not break implementations. No subject IDs, tokens or other high-cardinality values are ever passed.

Index

Constants

This section is empty.

Variables

Events lists every Event, for backends that pre-register counters.

Functions

This section is empty.

Types

type Event

type Event string

Event names a counter.

const (
	LoginSuccess       Event = "login_success"
	LoginFailure       Event = "login_failure"
	Logout             Event = "logout"
	RefreshSuccess     Event = "refresh_success"
	RefreshFailure     Event = "refresh_failure"
	RefreshReuse       Event = "refresh_reuse"
	TokenVerifySuccess Event = "token_verify_success" //nolint:gosec // G101: a metric name, not a credential
	TokenVerifyFailure Event = "token_verify_failure"
	SessionRevoked     Event = "session_revoked"
	PolicyDenied       Event = "policy_denied"
	Signup             Event = "signup"
	SignupFailure      Event = "signup_failure"
	RateLimited        Event = "rate_limited"

	PasswordResetRequested   Event = "password_reset_requested"
	PasswordReset            Event = "password_reset"
	PasswordResetFailure     Event = "password_reset_failure"
	PasswordChanged          Event = "password_changed"
	PasswordChangeFailure    Event = "password_change_failure"
	EmailVerified            Event = "email_verified"
	EmailVerificationFailure Event = "email_verification_failure"

	MFAChallenge Event = "mfa_challenge"
	MFASuccess   Event = "mfa_success"
	MFAFailure   Event = "mfa_failure"
)

type Noop

type Noop struct{}

Noop discards all metrics. It is the default when none are configured.

func (Noop) Inc

func (Noop) Inc(Event)

Inc implements Recorder.

type Recorder

type Recorder interface {
	Inc(e Event)
}

Recorder counts events. Implementations must be safe for concurrent use and must not block.

Jump to

Keyboard shortcuts

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