Bootstrap copied BFF and local accounts with public Sendico contracts (#34)
This commit is contained in:
1 parent
67dc5b5b1e
commit
7062672a87
556 files changed
+42291
-777
No files matched your search
@@ -0,0 +1,35 @@
|
||||
package sessionmetrics
|
||||
|
||||
import (
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promauto"
|
||||
)
|
||||
|
||||
type Operation string
|
||||
|
||||
const (
|
||||
Validation Operation = "validation"
|
||||
CurrentLogout Operation = "current_logout"
|
||||
AllLogout Operation = "all_logout"
|
||||
)
|
||||
|
||||
type Outcome string
|
||||
|
||||
const (
|
||||
Active Outcome = "active"
|
||||
Succeeded Outcome = "succeeded"
|
||||
AlreadyInactive Outcome = "already_inactive"
|
||||
MissingIdentity Outcome = "missing_identity"
|
||||
StorageError Outcome = "storage_error"
|
||||
)
|
||||
|
||||
var lifecycle = promauto.NewCounterVec(prometheus.CounterOpts{
|
||||
Namespace: "sendico",
|
||||
Subsystem: "auth",
|
||||
Name: "session_lifecycle_total",
|
||||
Help: "Session validation and logout outcomes.",
|
||||
}, []string{"operation", "outcome"})
|
||||
|
||||
func Observe(operation Operation, outcome Outcome) {
|
||||
lifecycle.WithLabelValues(string(operation), string(outcome)).Inc()
|
||||
}
|
||||
Reference in new issue
Block a user