mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
001589cd6d
Adds ability to record metrics and gather them for Prometheus.
21 lines
419 B
Go
21 lines
419 B
Go
package metrics
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/authelia/authelia/v4/internal/regulation"
|
|
)
|
|
|
|
// Provider implementation.
|
|
type Provider interface {
|
|
Recorder
|
|
regulation.MetricsRecorder
|
|
}
|
|
|
|
// Recorder of metrics.
|
|
type Recorder interface {
|
|
RecordRequest(statusCode, requestMethod string, elapsed time.Duration)
|
|
RecordVerifyRequest(statusCode string)
|
|
RecordAuthenticationDuration(success bool, elapsed time.Duration)
|
|
}
|