diff --git a/docs/docs/CHANGELOG.md b/docs/docs/CHANGELOG.md index 7b86e5d..d428cc0 100644 --- a/docs/docs/CHANGELOG.md +++ b/docs/docs/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +- Expose WEIGHT rule matches as Prometheus metrics. - Allow more OCI registry clients [based on feedback](https://github.com/TecharoHQ/anubis/pull/1253#issuecomment-3506744184). - Expose services directory in the embedded `(data)` filesystem. - Add Ukrainian locale ([#1044](https://github.com/TecharoHQ/anubis/pull/1044)). diff --git a/lib/anubis.go b/lib/anubis.go index da5727c..8dffe6a 100644 --- a/lib/anubis.go +++ b/lib/anubis.go @@ -576,6 +576,7 @@ func (s *Server) check(r *http.Request, lg *slog.Logger) (policy.CheckResult, *p return cr("bot/"+b.Name, b.Action, weight), &b, nil case config.RuleWeigh: lg.Debug("adjusting weight", "name", b.Name, "delta", b.Weight.Adjust) + policy.Applications.WithLabelValues("bot/"+b.Name, "WEIGH").Add(1) weight += b.Weight.Adjust } }