Documentation ¶
Index ¶
- type Prometheus
- func (r *Prometheus) RecordAuthentication(success, banned bool, authType string)
- func (r *Prometheus) RecordAuthenticationDuration(success bool, elapsed time.Duration)
- func (r *Prometheus) RecordRequest(statusCode, requestMethod string, elapsed time.Duration)
- func (r *Prometheus) RecordVerifyRequest(statusCode string)
- type Provider
- type Recorder
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) RecordAuthentication ¶
func (r *Prometheus) RecordAuthentication(success, banned bool, authType string)
RecordAuthentication takes the success and regulated booleans and a method string to record the authentication metrics.
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) 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) RecordVerifyRequest ¶
func (r *Prometheus) RecordVerifyRequest(statusCode string)
RecordVerifyRequest takes the statusCode string to record the verify endpoint request metrics.
type Provider ¶
type Provider interface { Recorder regulation.MetricsRecorder }
Provider implementation.