authmetrics

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package authmetrics defines global metrics and attributes for the auth service.

Index

Constants

This section is empty.

Variables

View Source
var (
	// AuthStatusSuccessAttribute is the constant attribute for the success auth status.
	AuthStatusSuccessAttribute = attribute.String("auth.status", "success")
	// AuthStatusFailedAttribute is the constant attribute for the failed auth status.
	AuthStatusFailedAttribute = attribute.String("auth.status", "failed")
)

Functions

func NewAuthIDAttribute

func NewAuthIDAttribute(id string) attribute.KeyValue

NewAuthIDAttribute creates an auth.id attribute.

func NewAuthModeAttribute

func NewAuthModeAttribute(authMode authmode.AuthMode) attribute.KeyValue

NewAuthModeAttribute creates an auth.mode attribute.

func SetRelyAuthMetrics

func SetRelyAuthMetrics(metrics *RelyAuthMetrics)

SetRelyAuthMetrics sets the global RelyAuthMetrics instance.

Types

type RelyAuthMetrics

type RelyAuthMetrics struct {
	// Total number of successful auth mode requests.
	AuthModeTotalRequests metric.Int64Counter
	// Duration of authentication requests.
	RequestDuration metric.Float64Histogram
}

RelyAuthMetrics hold semantic metrics of the rely-auth service.

func GetRelyAuthMetrics

func GetRelyAuthMetrics() *RelyAuthMetrics

GetRelyAuthMetrics gets the global RelyAuthMetrics instance.

func NewRelyAuthMetrics

func NewRelyAuthMetrics(meter metric.Meter) (*RelyAuthMetrics, error)

NewRelyAuthMetrics creates a RelyAuthMetrics instance from the OpenTelemetry meter.

Jump to

Keyboard shortcuts

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