FrontendMetrics

class gafaelfawr.metrics.FrontendMetrics(url, metric_reader=None)

Bases: GafaelfawrMetrics

Metric instruments for the Gafaelfawr frontend.

Parameters:
  • url (Union[Url, str]) – URL to the OpenTelemetry collector to which to send metrics.

  • metric_reader (MetricReader | None, default: None) – If provided, do not collect and send metrics to the OpenTelemetry collector, and instead use the provided metric reader. This is used by the test suite to disable the OpenTelemetry exporter in favor of an in-memory metrics reader that can be queried by the test suite.

login_attempts

Count of times Gafaelfawr sends the user to the identity provider for authentication. This does not include duplicate redirects when the given user already has an authentication in progress.

login_enrollment

Count of the number of Gafaelfawr redirects an authenticated but unknown user to the enrollment flow.

login_failures

Count of the times a login fails at the Gafaelfawr end, meaning that either something went wrong in Gafaelfawr itself, with the request to the remote authentication service, or via an error reported by the remote authentication service. This does not count cases where the authentication service never returns the user to us.

login_success_time

How long it takes for the user to go through the login process. The authenticated username must be included as the username attribute.

login_successes

Count of times the user returns successfully from the identity provider after authenticating. The authenticated username must be included as the username attribute.

request_auth

An authenticated request to a service. Currently this is only logged when a token is delegated to the service due to limitations in the Gafaelfawr design. The authenticated username must be included as the username attribute and the service name must be included as the service attribute.