diff --git a/glean-core/metrics.yaml b/glean-core/metrics.yaml index c82fd550a4..2b0563feee 100644 --- a/glean-core/metrics.yaml +++ b/glean-core/metrics.yaml @@ -410,7 +410,7 @@ glean.upload: no_lint: - COMMON_PREFIX - deleted_pending_pings_after_quota_hit: + deleted_pings_after_quota_hit: type: counter description: > The number of pings deleted after the quota diff --git a/glean-core/src/internal_metrics.rs b/glean-core/src/internal_metrics.rs index 3b421915b3..4472f8e794 100644 --- a/glean-core/src/internal_metrics.rs +++ b/glean-core/src/internal_metrics.rs @@ -52,7 +52,7 @@ pub struct UploadMetrics { pub ping_upload_failure: LabeledMetric, pub discarded_exceeding_pings_size: MemoryDistributionMetric, pub pending_pings_directory_size: MemoryDistributionMetric, - pub deleted_pending_pings_after_quota_hit: CounterMetric, + pub deleted_pings_after_quota_hit: CounterMetric, } impl UploadMetrics { @@ -100,8 +100,8 @@ impl UploadMetrics { MemoryUnit::Kilobyte, ), - deleted_pending_pings_after_quota_hit: CounterMetric::new(CommonMetricData { - name: "deleted_pending_pings_after_quota_hit".into(), + deleted_pings_after_quota_hit: CounterMetric::new(CommonMetricData { + name: "deleted_pings_after_quota_hit".into(), category: "glean.upload".into(), send_in_pings: vec!["metrics".into()], lifetime: Lifetime::Ping, diff --git a/glean-core/src/upload/mod.rs b/glean-core/src/upload/mod.rs index 878a0a8f7a..dfbb387817 100644 --- a/glean-core/src/upload/mod.rs +++ b/glean-core/src/upload/mod.rs @@ -316,6 +316,10 @@ impl PingUploadManager { for (metadata, (document_id, path, body, headers)) in pending_pings { pending_pings_directory_size += metadata.len() as usize; if pending_pings_directory_size > quota { + log::warn!( + "Pending pings directory has reached the size quota of {} bytes, outstanding pings will be deleted.", + PENDING_PINGS_DIRECTORY_QUOTA + ); enqueueing = false; } @@ -323,7 +327,7 @@ impl PingUploadManager { self.enqueue_ping(glean, &document_id, &path, &body, headers); } else if self.directory_manager.delete_file(&document_id) { self.upload_metrics - .deleted_pending_pings_after_quota_hit + .deleted_pings_after_quota_hit .add(glean, 1); } }