StateMetrics

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

Bases: GafaelfawrMetrics

Metric instruments based on stored state.

Collects metrics determined from the current stored state. These are gathered and reported by the maintenance cron job.

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.

sessions_active_users

Total number of unexpired user sessions (unexpired session tokens).

user_tokens_active

Total number of unexpired user tokens.