diff --git a/toolkit/components/reputationservice/ApplicationReputation.cpp b/toolkit/components/reputationservice/ApplicationReputation.cpp index 74577e386997..85ad23db3ed6 100644 --- a/toolkit/components/reputationservice/ApplicationReputation.cpp +++ b/toolkit/components/reputationservice/ApplicationReputation.cpp @@ -1882,8 +1882,9 @@ nsresult PendingLookup::OnStopRequestInternal(nsIRequest* aRequest, mozilla::glean::application_reputation::server_verdict.AccumulateSingleSample( std::min(response.verdict(), 7)); const char* ext = GetFileExt(mFileName); - AccumulateCategoricalKeyed(nsCString(ext), VerdictToLabel(std::min( - response.verdict(), 7))); + mozilla::glean::application_reputation::server_verdict_2.Get( + nsCString(ext), + VerdictToLabel(std::min(response.verdict(), 7))); switch (response.verdict()) { case safe_browsing::ClientDownloadResponse::DANGEROUS: aVerdict = nsIApplicationReputationService::VERDICT_DANGEROUS; diff --git a/toolkit/components/reputationservice/ApplicationReputationTelemetryUtils.cpp b/toolkit/components/reputationservice/ApplicationReputationTelemetryUtils.cpp index 10d5975ecf50..2c0115da8ae1 100644 --- a/toolkit/components/reputationservice/ApplicationReputationTelemetryUtils.cpp +++ b/toolkit/components/reputationservice/ApplicationReputationTelemetryUtils.cpp @@ -7,8 +7,6 @@ #include "chrome/common/safe_browsing/csd.pb.h" using ServerLabel = mozilla::glean::application_reputation::Server2Label; -using ServerVerdictLabel = - mozilla::Telemetry::LABELS_APPLICATION_REPUTATION_SERVER_VERDICT_2; struct NSErrorTelemetryResult { nsresult mValue; @@ -174,20 +172,19 @@ ServerLabel HTTPStatusToLabel(uint32_t aStatus) { } } -mozilla::Telemetry::LABELS_APPLICATION_REPUTATION_SERVER_VERDICT_2 -VerdictToLabel(uint32_t aVerdict) { +nsLiteralCString VerdictToLabel(uint32_t aVerdict) { switch (aVerdict) { case safe_browsing::ClientDownloadResponse::DANGEROUS: - return ServerVerdictLabel::Dangerous; + return "Dangerous"_ns; case safe_browsing::ClientDownloadResponse::DANGEROUS_HOST: - return ServerVerdictLabel::DangerousHost; + return "DangerousHost"_ns; case safe_browsing::ClientDownloadResponse::POTENTIALLY_UNWANTED: - return ServerVerdictLabel::PotentiallyUnwanted; + return "PotentiallyUnwanted"_ns; case safe_browsing::ClientDownloadResponse::UNCOMMON: - return ServerVerdictLabel::Uncommon; + return "Uncommon"_ns; case safe_browsing::ClientDownloadResponse::UNKNOWN: - return ServerVerdictLabel::Unknown; + return "Unknown"_ns; default: - return ServerVerdictLabel::Safe; + return "Safe"_ns; } } diff --git a/toolkit/components/reputationservice/ApplicationReputationTelemetryUtils.h b/toolkit/components/reputationservice/ApplicationReputationTelemetryUtils.h index cf63e8aa74b7..5956e24a6a03 100644 --- a/toolkit/components/reputationservice/ApplicationReputationTelemetryUtils.h +++ b/toolkit/components/reputationservice/ApplicationReputationTelemetryUtils.h @@ -40,7 +40,6 @@ mozilla::glean::application_reputation::Server2Label HTTPStatusToLabel( /** * Convert verdict type to telemetry labels */ -mozilla::Telemetry::LABELS_APPLICATION_REPUTATION_SERVER_VERDICT_2 -VerdictToLabel(uint32_t aVerdict); +nsLiteralCString VerdictToLabel(uint32_t aVerdict); #endif // ApplicationReputationTelemetryUtils_h__ diff --git a/toolkit/components/reputationservice/metrics.yaml b/toolkit/components/reputationservice/metrics.yaml index 17817032d229..33738c72abe6 100644 --- a/toolkit/components/reputationservice/metrics.yaml +++ b/toolkit/components/reputationservice/metrics.yaml @@ -199,6 +199,38 @@ application_reputation: expires: never telemetry_mirror: APPLICATION_REPUTATION_SERVER_VERDICT + server_verdict_2: + type: dual_labeled_counter + description: > + Application reputation remote verdict, keyed by file extension + + This metric was generated to correspond to the Legacy Telemetry + categorical histogram APPLICATION_REPUTATION_SERVER_VERDICT_2. + dual_labels: + key: + description: File extension. + category: + labels: + - Safe + - Dangerous + - Uncommon + - PotentiallyUnwanted + - DangerousHost + - Unknown + description: Labels of the keyed categorical legacy telemetry histogram + APPLICATION_REPUTATION_SERVER_VERDICT_2. + bugs: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1501974 + - https://bugzilla.mozilla.org/show_bug.cgi?id=1589042 + data_reviews: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1501974 + - https://bugzilla.mozilla.org/show_bug.cgi?id=1589042 + notification_emails: + - dlee@mozilla.com + - safebrowsing-telemetry@mozilla.org + expires: never + telemetry_mirror: APPLICATION_REPUTATION_SERVER_VERDICT_2 + remote_lookup_response_time: type: timing_distribution description: >