Skip to content

Commit

Permalink
chore(metrics): Added more metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Malinowski authored and Edward Malinowski committed Jun 26, 2024
1 parent e38798d commit 8a84593
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
7 changes: 6 additions & 1 deletion fence/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ def set_flask_session_values(user):
current_app.scoped_session().add(user)
current_app.scoped_session().commit()

from fence.metrics import login_counter
from fence.metrics import (
login_counter,
fence_login_counter,
google_login_counter,
ras_login_counter,
)

login_counter.inc()

Expand Down
3 changes: 0 additions & 3 deletions fence/blueprints/login/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,3 @@ def _login(username, idp_name, email=None, id_from_idp=None):
if flask.session.get("redirect"):
return flask.redirect(flask.session.get("redirect"))
return flask.jsonify({"username": username})
from fence.metrics import login_counter

login_counter.inc()
2 changes: 0 additions & 2 deletions fence/blueprints/login/fence_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ def get(self):
)
self.post_login()

from fence.metrics import fence_login_counter

fence_login_counter.inc()

if config["REGISTER_USERS_ON"]:
Expand Down
2 changes: 0 additions & 2 deletions fence/blueprints/login/ras.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ def post_login(self, user=None, token_result=None, id_from_idp=None):
expires,
)

from fence.metrics import ras_login_counter

ras_login_counter.inc()

flask.current_app.ras_client.store_refresh_token(
Expand Down

0 comments on commit 8a84593

Please sign in to comment.