-
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
This proposal adds two observability improvements to casbin-prometheus-logger:
- Expose current policy counts by type (
p,g,g1,g2,g3) - Allow optional labels for enforce metrics
Currently, the prometheusLogger focuses on policy operation events (Add / Remove / Load / Save), but lacks visibility into policy state. There is no metric showing how many policy rules are loaded by type, making it hard to monitor permission growth.
In addition, the Enforce metrics are too coarse. casbin_enforce_total only includes allowed and domain (prometheus_logger.go)
enforceTotal: prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "casbin_enforce_total",
Help: "Total number of enforce requests",
},
[]string{"allowed", "domain"},
),
This makes it difficult to identify high-traffic subjects or debug subject-specific authorization issues.
Reactions are currently unavailable
Metadata
Metadata
Labels
enhancementNew feature or requestNew feature or request