Bug 1922193 - Add telemetry probes for invalid first party partitioned cookies. r=valentin,cookie-reviewers,edgul

Depends on D226126

Differential Revision: https://phabricator.services.mozilla.com/D226127
This commit is contained in:
Tim Huang 2024-11-05 18:50:35 +00:00
parent da988c20a5
commit 01b279441e
4 changed files with 36 additions and 0 deletions

View File

@ -1838,6 +1838,8 @@ void CookiePersistentStorage::InitDBConn() {
RefPtr<Cookie> invalidCookie =
Cookie::Create(*tuple.cookie, tuple.originAttributes);
cleanupCookies.AppendElement(invalidCookie);
mozilla::glean::networking::
cookie_count_invalid_first_party_partitioned_in_db.Add(1);
continue;
}

View File

@ -313,6 +313,8 @@ CookieServiceChild::RecordDocumentCookie(Cookie* aCookie,
COOKIE_LOGSTRING(LogLevel::Error,
("Invalid first-party partitioned cookie without "
"partitioned cookie attribution from the document."));
mozilla::glean::networking::set_invalid_first_party_partitioned_cookie.Add(
1);
MOZ_DIAGNOSTIC_ASSERT(false);
return CookieNotificationAction::NoActionNeeded;
}

View File

@ -607,6 +607,8 @@ void CookieStorage::AddCookie(CookieParser* aCookieParser,
COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, aCookieHeader,
"Invalid first-party partitioned cookie without "
"partitioned cookie attribution.");
mozilla::glean::networking::set_invalid_first_party_partitioned_cookie.Add(
1);
MOZ_DIAGNOSTIC_ASSERT(false);
return;
}

View File

@ -215,6 +215,36 @@ networking:
- edgul@mozilla.com
expires: 146
cookie_count_invalid_first_party_partitioned_in_db:
type: counter
description: >
This counts the number of invalid first-party partitioned cookies that
don't have the partitioned cookie attribution(CHIPS).
bugs:
- https://bugzilla.mozilla.org/1922193
data_reviews:
- https://bugzilla.mozilla.org/1922193
notification_emails:
- bvandersloot@mozilla.com
- tihuang@mozilla.com
- edgul@mozilla.com
expires: 146
set_invalid_first_party_partitioned_cookie:
type: counter
description: >
This counts the number of times we set an invalid first-party partitioned
cookie.
bugs:
- https://bugzilla.mozilla.org/1922193
data_reviews:
- https://bugzilla.mozilla.org/1922193
notification_emails:
- bvandersloot@mozilla.com
- tihuang@mozilla.com
- edgul@mozilla.com
expires: 146
cookie_purge_max:
type: custom_distribution
description: >