Counter for tokens created

Counts the number of tokens created based on different methods for obtaining tokens, categorized by the status of the response.

Table 1. fourjs_gip_token_request_count
Labels Value Purpose
  1. mode: The mode label may be one of the following values shown in the table below.
    Value Description
    authorization_code Request a token in exchange for an authorization code.
    client_credentials Request a token via client credentials
    password Request a token via login and password
    refresh_token Request the renewal of an access token in exchange for a refresh token
  2. status: The status label may be one of the following values shown in the table below.
    Value Description
    ok Request processed and tokens returned
    denied Token generation denied due to invalid credentials or permissions (scope)
    invalid_request Invalid request: (see logs)
    error Unexpected error: (see logs)
Number of tokens created or failed
  • Count the number of access tokens, ID tokens, and refresh tokens that are being created or exchanged.
  • May raise an alert if there are too many invalid_request or error attempts

This metric is set by default in the GAS and can be disabled through the BDL Prometheus API by setting prometheus.enabled=false in the fglprofile.

Metric examples
# HELP fourjs_gip_token_request_count Number of requests for tokens
# TYPE fourjs_gip_token_request_count counter
fourjs_gip_token_request_count{mode="client_credentials",status="ok"} 1
fourjs_gip_token_request_count{mode="authorization_code",status="ok"} 2
fourjs_gip_token_request_count{mode="password",status="ok"} 1
fourjs_gip_token_request_count{mode="refresh_token",status="ok"} 2
fourjs_gip_token_request_count{mode="client_credentials",status="denied"} 2