Open jdrivas opened 6 years ago
[I 2018-11-25 23:54:28.257 JupyterHub auth0:109] authenticating with Auth0 [D 2018-11-25 23:54:28.476 JupyterHub base:357] Setting cookie jupyterhub-session-id: {'httponly': True, 'secure': True} [D 2018-11-25 23:54:28.476 JupyterHub base:362] Setting cookie for auth0_58b8af3b20e74746f356e4c9: jupyterhub-hub-login [D 2018-11-25 23:54:28.476 JupyterHub base:357] Setting cookie jupyterhub-hub-login: {'httponly': True, 'secure': True, 'path': '/hub/'} [I 2018-11-25 23:54:28.476 JupyterHub base:499] User logged in: auth0_58b8af3b20e74746f356e4c9 [I 2018-11-25 23:54:28.477 JupyterHub oauth2:183] oauth2: OAuthCallbackHandler for user: "<User(auth0_58b8af3b20e74746f356e4c9 1/1 running)>" [I 2018-11-25 23:54:28.477 JupyterHub oauth2:184] oauth2: OAuthCallbackHandler redirecting to "/user/auth0_58b8af3b20e74746f356e4c9/" [I 2018-11-25 23:54:28.478 JupyterHub log:158] 302 GET /hub/oauth_callback?code=[secret]&state=[secret] -> /user/auth0_58b8af3b20e74746f356e4c9/ (@10.138.0.9) 221.68ms [I 2018-11-25 23:54:28.687 JupyterHub log:158] 302 GET /hub/api/oauth2/authorize?client_id=jupyterhub-user-auth0_58b8af3b20e74746f356e4c9&redirect_uri=%2Fuser%2Fauth0_58b8af3b20e74746f356e4c9%2Foauth_callback&response_type=code&state=[secret] -> /user/auth0_58b8af3b20e74746f356e4c9/oauth_callback?code=[secret]&state=[secret] (auth0_58b8af3b20e74746f356e4c9@10.138.0.9) 51.85ms [I 2018-11-25 23:54:28.767 JupyterHub log:158] 200 POST /hub/api/oauth2/token (auth0_58b8af3b20e74746f356e4c9@10.8.0.30) 23.75ms [I 2018-11-25 23:54:28.790 JupyterHub log:158] 200 GET /hub/api/authorizations/token/[secret] (auth0_58b8af3b20e74746f356e4c9@10.8.0.30) 15.71ms
[I 2018-11-25 23:51:47.945 JupyterHub auth0:75] Auth0LogoutHandler: Logging out <User(auth0_58a7790682b0ca077463b869 1/1 running)>. [I 2018-11-25 23:51:47.945 JupyterHub auth0:84] Auth0LogoutHandler: Redirecting to: https://momentlabs.auth0.com/logout?returnTo=https%3A%2F%2Fnotebooks.athenaeumnb.com%2Flogout&client_id=GRagFRYsYX4icgF3k3rKOF50gcCCoZUp [I 2018-11-25 23:51:47.946 JupyterHub log:158] 302 GET /hub/auth0_logout -> https://momentlabs.auth0.com/logout?returnTo=https%3A%2F%2Fnotebooks.athenaeumnb.com%2Flogout&client_id=GRagFRYsYX4icgF3k3rKOF50gcCCoZUp (auth0_58a7790682b0ca077463b869@10.138.0.9) 9.44ms [I 2018-11-25 23:51:48.182 JupyterHub log:158] 302 GET /logout -> /hub/logout (@10.138.0.9) 0.75ms [I 2018-11-25 23:51:48.233 JupyterHub login:19] User logged out: auth0_58a7790682b0ca077463b869
A simple Log based metric in Stackdriver that looks for lines like:
[I 2018-11-25 23:54:28.476 JupyterHub base:499] User logged in: auth0_58b8af3b20e74746f356e4c9
and
[I 2018-11-25 23:51:48.233 JupyterHub login:19] User logged out: auth0_58a7790682b0ca077463b869
The metric creates a label which extracts an RE like (auth0_[a-f0-9]+)
from the textPayload. This seems to do enough for now.
A possible first solution is to create some metrics in GCP logs [x] Log in [ ] Log out