Repository navigation
Count passkey adoption in the metrics gauges - #389
Merged
Merged
Conversation
sheaf_auth_totp_enabled has always answered "how many people use TOTP", with no equivalent for passkeys. The only passkey telemetry was the four sign-in outcomes on logins_total, and those count ceremonies rather than people: one person signing in daily from two devices moves them more than ten people who enrolled a passkey and then mostly use a password. Adds two gauges, filled by the existing gauge refresh: sheaf_auth_passkey_users users holding at least one usable passkey sheaf_auth_passkey_credentials credentials, by usable=true|false Users is the headline number rather than credentials because somebody who enrols a phone and a laptop is one adopter, not two. `usable` carries the same meaning as the field of that name in the passkeys API: a credential is bound forever to the relying-party ID it was enrolled under, so after a domain move the rows that no longer match are still listed to their owner but cannot sign anyone in. Splitting on it means such a move reads as credentials going dark rather than as a collapse in adoption. The total, usable and adopter counts come from one statement, so they share a snapshot and the unusable count, derived by subtraction, cannot dip below zero when an enrolment lands mid-refresh. When no relying party resolves, because passkeys are off or the base URL will not yield a host, nothing can sign anyone in: adoption is set to zero and every credential counts as unusable. Set rather than skipped, since a skipped gauge freezes at its last healthy value and reads as though passkeys were still working. Three tests: the four passkey login outcomes are present from the first scrape (passkey_rp_mismatch in particular is only useful to alert on if the series exists to compare against), the gauges populate with both usable buckets present, and an account with one current and one moved credential lands one in each bucket, agrees with the API's usable field, and counts once as an adopter. Also brings the logins_total outcome list in METRICS.md back in line with the code. It had drifted, missing the account-standing refusals as well as the four passkey outcomes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds passkey adoption to the metrics gauges.
sheaf_auth_totp_enabledhas always answered "how many people use TOTP"; there was no equivalent for passkeys, only the sign-in outcomes onlogins_total, which count ceremonies rather than people.sheaf_auth_passkey_users: users holding at least one usable passkey. Users rather than credentials, because someone who enrols a phone and a laptop is one adopter.sheaf_auth_passkey_credentials{usable="true"|"false"}: enrolled credentials, split on the same rule the passkeys API uses for itsusablefield (the credential'srp_idmatches the instance's current relying-party ID). After a domain move the old credentials show up as going dark rather than as a collapse in adoption.usable="false"count cannot dip below zero when an enrolment lands mid-refresh.logins_totaloutcome list is brought back in line with the code: it was missing the account-standing refusals and the four passkey outcomes.Verification
usablebuckets are present after a gauge pass, and adopters never exceed usable credentials.selfhosted/metricspasses. Ruff clean.