TeskaLabs / seacat-auth

SeaCat Auth provides authentication, authorization, identity management, session management and other access control features.
GNU General Public License v3.0
11 stars 7 forks source link

Metrics refactoring #298

Open ateska opened 10 months ago

ateska commented 10 months ago

Currently, metrics produced by the SeaCat Auth are a bit illogical and should be refactored:

^- these two may be about the implementation in the InfluxDB forwarded in ASAB, it is linked with Prometheus implementation.

https://github.com/TeskaLabs/seacat-auth/blob/27011e05fc4c1b7b4406686b3d99195062e864e9/seacatauth/session/algorithmic.py#L44

https://github.com/TeskaLabs/seacat-auth/blob/27011e05fc4c1b7b4406686b3d99195062e864e9/seacatauth/session/service.py#L84

Proposed change:

self.AnonymousSessionCounter: asab.metrics.Counter = self.MetricsService.create_counter(
            "sessions",
            tags={"help": "Number of anonymous sessions created."},
            init_values={"anonymous": 0}
)
self.SessionGauge = self.MetricsService.create_gauge(
            "sessions",
            tags={"help": "Counts active sessions."},
            init_values={"regular": 0}
)