<!--
Copyright 2020 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<!--
This file is used to generate a comprehensive list of Login histograms
along with a detailed description for each histogram.

For best practices on writing histogram descriptions, see
https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histograms/README.md

Please follow the instructions in the OWNERS file in this directory to find a
reviewer. If no OWNERS file exists, please consider signing up at
go/reviewing-metrics (Googlers only), as all subdirectories are expected to
have an OWNERS file. As a last resort you can send the CL to
chromium-metrics-reviews@google.com.
-->

<histogram-configuration>

<histograms>

<histogram name="Login.AllowlistCOILFallback" enum="Boolean"
    expires_after="2027-03-31">
  <owner>emaamari@google.com</owner>
  <owner>cros-lurs@google.com</owner>
  <owner>cros-oac@google.com</owner>
  <summary>
    Chrome OS histogram that keeps track of cases where the user_allowlist
    policy is not present, forcing us to use the user_whitelist policy instead.
    We emit false to this histogram when user_allowlist is present. We emit true
    when user_allowlist is not present and user_whitelist is present and used as
    fallback. These checks happen during login policies decoding, which occurs
    every time device settings are loaded or stored.

    Warning: this histogram was expired from 2023-03-19 to 2024-04-24; data may
    be missing.
  </summary>
</histogram>

<histogram name="Login.BrowserShutdownTime" units="ms"
    expires_after="2026-11-15">
  <owner>hidehiko@chromium.org</owner>
  <owner>junis@google.com</owner>
  <owner>cros-oac@google.com</owner>
  <summary>
    Tracks the browser process shutdown time from when SIGTERM is sent to the
    browser process to when the browser process group exits (or gets killed by
    SIGABRT).
  </summary>
</histogram>

<histogram name="Login.CryptohomePasswordlessRecoveryResult"
    enum="CryptohomeRecoveryResult" expires_after="2027-03-31">
  <owner>iscsi@google.com</owner>
  <owner>cros-lurs@google.com</owner>
  <summary>
    Tracks the result of the cryptohome recovery and the failure reason for
    passwordless users. Recorded when the recovery attempt finished.
  </summary>
</histogram>

<histogram name="Login.CryptohomeRecoveryDuration.{Result}" units="ms"
    expires_after="2027-03-31">
  <owner>yunkez@google.com</owner>
  <owner>cros-lurs@google.com</owner>
  <summary>
    Records the time taken for the Cryptohome recovery when it {Result}.
  </summary>
  <token key="Result">
    <variant name="Failure" summary="failed"/>
    <variant name="Success" summary="succeeded"/>
  </token>
</histogram>

<histogram name="Login.CryptohomeRecoveryResult"
    enum="CryptohomeRecoveryResult" expires_after="2027-03-31">
  <owner>yunkez@google.com</owner>
  <owner>cros-lurs@google.com</owner>
  <summary>
    Tracks the result of the cryptohome recovery and the failure reason.
    Recorded when the recovery attempt finished.
  </summary>
</histogram>

<histogram name="Login.CustomFlags" enum="LoginCustomFlags"
    expires_after="never">
<!-- expires-never: monitors 'black screen on login' user experience. -->

  <owner>antrim@chromium.org</owner>
  <owner>cros-lurs@google.com</owner>
  <summary>
    A set of chrome flags that triggered browser restart on Chrome OS after user
    sign in. Chrome needs to be restarted if the device owner set of flags is
    different from the user flags. Which means that there is a flag difference
    which led to this restart. This difference is reported by this metric.
  </summary>
</histogram>

<histogram name="Login.DevicePolicyState" enum="DevicePoliciesState"
    expires_after="2026-11-15">
  <owner>igorcov@chromium.org</owner>
  <owner>chromeos-commercial-remote-management@chromium.org</owner>
  <summary>
    Reports the device ownership, the state of the device policy and the state
    of the owner key. Logged only for the devices that have ownership taken as
    per install attributes. Is logged at every device policy load.
  </summary>
</histogram>

<histogram name="Login.FailureReason" enum="LoginFailureReason"
    expires_after="2027-03-31">
  <owner>antrim@chromium.org</owner>
  <owner>cros-lurs@google.com</owner>
  <summary>Chrome OS login failure reason.</summary>
</histogram>

<histogram name="Login.Flow.{UserVisibility}.{UserCount}"
    enum="LoginFlowUserLoginType" expires_after="2027-03-31">
  <owner>antrim@chromium.org</owner>
  <owner>cros-lurs@google.com</owner>
  <summary>
    Report the type of user login and the number of it on a device. It is
    triggered when a login is successful
  </summary>
  <token key="UserVisibility">
    <variant name="HideUsers" summary="ShowUserOnSignin policy is set false"/>
    <variant name="ShowUsers" summary="ShowUserOnSignin policy is set true"/>
  </token>
  <token key="UserCount">
    <variant name="0" summary="0 users"/>
    <variant name="1" summary="1 users"/>
    <variant name="2" summary="2 users"/>
    <variant name="Few" summary="3 to 5 users"/>
    <variant name="Many" summary="More than 5 users"/>
  </token>
</histogram>

<histogram name="Login.InvalidCombinationsOfAllowedUsersPolicies"
    enum="AllowedUsersPoliciesInvalidState" expires_after="2027-03-31">
  <owner>emaamari@google.com</owner>
  <owner>src/chromeos/ash/components/policy/OWNERS</owner>
  <summary>
    Chrome OS histogram that keeps track of cases where devices have an invalid
    combination of allow_new_users and user_allowlist policies. This is emitted
    during the decoding of login policies.

    Warning: this histogram was expired from 2024-02-25 to 2025-03-14; data may
    be missing.
  </summary>
</histogram>

<histogram name="Login.IsTokenHandleInSyncWithRefreshToken" enum="Boolean"
    expires_after="2027-03-31">
  <owner>sinhak@chromium.org</owner>
  <owner>cros-lurs@google.com</owner>
  <summary>
    Boolean histogram that indicates if token handle is in sync with the user's
    current refresh token - i.e. if token handle checks are performed for token
    handles that actually belong to the user's current refresh token. If this is
    not the case, it can result in users getting unnecessary logout
    notifications. This histogram is logged once at the start of a user's
    session.
  </summary>
</histogram>

<histogram name="Login.IsTokenHandleInSyncWithRefreshTokenPostRefactoring"
    enum="Boolean" expires_after="2027-03-31">
  <owner>emaamari@google.com</owner>
  <owner>cros-lurs@google.com</owner>
  <summary>
    Boolean histogram that indicates if token handle is in sync with the user's
    current refresh token - i.e. if token handle checks are performed for token
    handles that actually belong to the user's current refresh token. If this is
    not the case, it can result in users getting unnecessary logout
    notifications. This histogram is logged once at the start of a user's
    session. This histogram replaces the
    Login.IsTokenHandleInSyncWithRefreshToken histogram after launching the
    UseTokenHandleStore ash feature, which changes the way we manage token
    handles. Warning: this histogram was expired from 2025-12-31 to 2026-03-19;
    data may be missing.
  </summary>
</histogram>

<histogram name="Login.NewUserPriorityPrefsSyncResult"
    enum="NewUserPriorityPrefsSyncResult" expires_after="2027-03-31">
  <owner>mslus@chromium.org</owner>
  <owner>chromeos-commercial-identity@google.com</owner>
  <summary>Records whether a new user's priority prefs sync timed out.</summary>
</histogram>

<histogram name="Login.NewUserPriorityPrefsSyncTime" units="ms"
    expires_after="2027-03-31">
  <owner>mslus@chromium.org</owner>
  <owner>chromeos-commercial-identity@google.com</owner>
  <summary>
    Time spent waiting for priority preferences to sync after new user sign in.
    The operation will time out after 10s.
  </summary>
</histogram>

<histogram name="Login.NumberOfUsersOnLoginScreen" units="units"
    expires_after="2027-03-31">
  <owner>mslus@chromium.org</owner>
  <owner>chromeos-commercial-identity@google.com</owner>
  <summary>
    Records the number of users the login screen was initialized with. It is
    emitted on processing the user list before displaying the screen. The count
    includes all Regular, Child and Active Directory users.
  </summary>
</histogram>

<histogram name="Login.OfflineLoginWithHiddenUserPods"
    enum="ChromeOSHiddenUserPodsOfflineLogin" expires_after="2027-03-31">
  <owner>mslus@chromium.org</owner>
  <owner>chromeos-commercial-identity@google.com</owner>
  <summary>
    Records offline login attempts with user pods hidden on the login screen.

    Warning: this histogram was expired from 2023-12-24 to 2025-03-14; data may
    be missing.
  </summary>
</histogram>

<histogram name="Login.PageLoad.DetectionType" enum="LoginDetectionType"
    expires_after="2027-05-30">
  <owner>yigu@chromium.org</owner>
  <owner>tbansal@chromium.org</owner>
  <owner>web-identity-eng@google.com</owner>
  <summary>
    Type of login detected for a page load based on different heuristics.
    Recorded once per page load.
  </summary>
</histogram>

<histogram name="Login.PasswordChanged.ReauthReason" enum="LoginReauthReasons"
    expires_after="2027-03-31">
  <owner>antrim@chromium.org</owner>
  <owner>cros-lurs@google.com</owner>
  <summary>
    Tracks the reason why a user was sent through the GAIA re-auth flow which
    caused the local password change.
  </summary>
</histogram>

<histogram name="Login.PasswordNotChanged.ReauthReason"
    enum="LoginReauthReasons" expires_after="2027-03-31">
  <owner>antrim@chromium.org</owner>
  <owner>cros-lurs@google.com</owner>
  <summary>
    Tracks the reason why a user was sent through the GAIA re-auth flow which
    did not cause the local password change.
  </summary>
</histogram>

<histogram name="Login.PromptToCompleteLoginTime" units="ms"
    expires_after="2027-03-31">
  <owner>antrim@chromium.org</owner>
  <owner>achuith@chromium.org</owner>
  <owner>cros-lurs@google.com</owner>
  <summary>
    Time from first display of the login prompt until the user completes signing
    in.
  </summary>
</histogram>

<histogram name="Login.PromptToLoginTime" units="ms" expires_after="2027-03-31">
  <owner>khmel@chromium.org</owner>
  <owner>antrim@chromium.org</owner>
  <owner>cros-lurs@google.com</owner>
  <summary>
    Time from first display of the login prompt until the existing user
    completes signing in.
  </summary>
</histogram>

<histogram name="Login.ReauthToken.FetchDuration.{Result}" units="ms"
    expires_after="2027-03-31">
  <owner>yunkez@google.com</owner>
  <owner>cros-lurs@google.com</owner>
  <summary>
    Records the fetch duration of the reauth request token from the recovery
    service when it {Result}. This is recorded on the GAIA reauth screen when
    Cryptohome recovery is deemed to be needed in high probablity.

    Warning: this histogram was expired from 2022-06-02 to 2022-08-18 and from
    2025-12-28 to 2026-03-19; data may be missing.
  </summary>
  <token key="Result">
    <variant name="Failure" summary="fails to fetch"/>
    <variant name="Success" summary="successfully fetches"/>
  </token>
</histogram>

<histogram name="Login.SessionExitType" enum="LoginSessionExitType"
    expires_after="2027-01-31">
  <owner>iby@chromium.org</owner>
  <summary>
    Tracks whether a ChromeOS user was logged out because Chrome repeatedly
    crashed.
  </summary>
</histogram>

<histogram name="Login.StateKeyGenerationStatus"
    enum="LoginStateKeyGenerationStatus" expires_after="2026-09-06">
  <owner>sergiyb@chromium.org</owner>
  <owner>chromeos-commercial-remote-management@chromium.org</owner>
  <summary>
    Result of a state key generation operation.

    Warning: this histogram was expired from 2019-10-29 (M78) to 2023-02-09
    (M110); data may be missing.

    Starting in 2023-08-22 (M116), the value MISSING_IDENTIFIERS is no longer
    reported. Instead we report MISSING_MACHINE_SERIAL_NUMBER or
    MISSING_DISK_SERIAL_NUMBER when only one of the identifiers is missing, or
    MISSING_ALL_IDENTIFIERS when all are missing.
  </summary>
</histogram>

<histogram name="Login.SuccessReason" enum="LoginSuccessReason"
    expires_after="2027-03-31">
  <owner>achuith@chromium.org</owner>
  <owner>antrim@chromium.org</owner>
  <owner>cros-lurs@google.com</owner>
  <summary>Chrome OS login success reason.</summary>
</histogram>

<histogram name="Login.SwitchToFeatureFlagMappingStatus"
    enum="LoginFeatureFlagMappingStatus" expires_after="2022-04-10">
  <owner>hidehiko@chromium.org</owner>
  <owner>junis@google.com</owner>
  <summary>
    Tracks whether switches were mapped to feature flags in session_manager for
    compatibility. session_manager does this and emits UMA samples when
    encountering old device settings files that still contain feature
    configuration in command line switch representation. This data will inform
    the decision when to remove this compatibility code.
  </summary>
</histogram>

<histogram name="Login.TokenCheckResponseTime" units="ms"
    expires_after="2027-03-31">
  <owner>antrim@chromium.org</owner>
  <owner>cros-lurs@google.com</owner>
  <summary>
    Time between sending a request to, and receiving a reply from, GAIA token
    endpoint to validate TokenInfo.

    Warning: this histogram was expired from 2024-09-22 to 2025-03-14; data may
    be missing.
  </summary>
</histogram>

<histogram name="Login.TokenObtainResponseTime" units="ms"
    expires_after="2027-03-31">
  <owner>antrim@chromium.org</owner>
  <owner>cros-lurs@google.com</owner>
  <summary>
    Time between sending a request to, and receiving a reply from, GAIA token
    endpoint to obtain TokenInfo.

    Warning: this histogram was expired from 2021-04-01 to 2023-12-05, data may
    be missing.
  </summary>
</histogram>

</histograms>

</histogram-configuration>
