# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

# This file defines the metrics that will be gathered for the "logins"
# storage component.
# These are emitted for all users of the component.  Additional metrics
# specific to the *syncing* of logins are defined in a separate "sync_ping"
# package.
#
# Changes to these metrics require data review, which should take into
# consideration the following known consumers of the logins component
# Android bindings:
#
#  * Fenix for Android

---
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0

logins_store:
  # These track when we need to regenerate the encryption key which causes all
  # local data to be lost
  key_regenerated_lost:
    type: event
    description: >
      The encryption key was regenerated because it was lost
    bugs:
      - https://github.com/mozilla/application-services/issues/4554
    data_reviews:
      - https://github.com/mozilla/application-services/issues/4582
      - https://github.com/mozilla/application-services/issues/4899
      - https://github.com/mozilla/application-services/issues/5051
    data_sensitivity:
      - technical
    notification_emails:
      - synced-client-integrations@mozilla.com
      - bdk@mozilla.com
    expires: never

  key_regenerated_corrupt:
    type: event
    description: >
      The encryption key was regenerated because it didn't match the encrypted
      data
    bugs:
      - https://github.com/mozilla/application-services/issues/4554
    data_reviews:
      - https://github.com/mozilla/application-services/issues/4582
      - https://github.com/mozilla/application-services/issues/4899
      - https://github.com/mozilla/application-services/issues/5051
    data_sensitivity:
      - technical
    notification_emails:
      - synced-client-integrations@mozilla.com
      - bdk@mozilla.com
    expires: never

  key_regenerated_other:
    type: event
    description: >
      The encryption key was regenerated for an unknown reason
    bugs:
      - https://github.com/mozilla/application-services/issues/4554
    data_reviews:
      - https://github.com/mozilla/application-services/issues/4582
      - https://github.com/mozilla/application-services/issues/4899
      - https://github.com/mozilla/application-services/issues/5051
    data_sensitivity:
      - technical
    notification_emails:
      - synced-client-integrations@mozilla.com
      - bdk@mozilla.com
    expires: never

  local_undecryptable_deleted:
    type: counter
    description: >
      Track how many logins we deleted locally due to various reasons
      that prevent us from decrypting the login
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1972437
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1972437
    data_sensitivity:
      - technical
    notification_emails:
      - skhamis@mozilla.com
      - synced-client-integrations@mozilla.com
    expires: "never"

  mirror_undecryptable_deleted:
    type: counter
    description: >
      Track how many logins we deleted in the mirror table due to various reasons
      that prevent us from decrypting the login
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1972437
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1972437
    data_sensitivity:
      - technical
    notification_emails:
      - skhamis@mozilla.com
      - synced-client-integrations@mozilla.com
    expires: "never"
