Skip to content

Commit eb93859

Browse files
fix(storage): emit delete metric for the Azure blob backend (#6469)
The S3 (`s3_compatible_storage`) and GCS/opendal backends both increment `object_storage_requests_total{action="delete_object"}` on delete, but the Azure blob backend did not, so delete activity was invisible in metrics for Azure-backed deployments. Increment the counter (and record the request-duration histogram) in `AzureBlobStorage::delete`. Since the Azure backend has no batch-delete API, `bulk_delete` already funnels through `delete` one blob at a time, so this covers both single and bulk deletes with no other changes.
1 parent 710aa11 commit eb93859

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

quickwit/quickwit-storage/src/object_storage/azure_blob_storage.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ use quickwit_common::retry::{RetryParams, Retryable, retry};
3434
use quickwit_common::uri::Uri;
3535
use quickwit_common::{chunk_range, ignore_error_kind, into_u64_range};
3636
use quickwit_config::{AzureStorageConfig, StorageBackend};
37+
use quickwit_metrics::HistogramTimer;
3738
use regex::Regex;
3839
use tantivy::directory::OwnedBytes;
3940
use thiserror::Error;
@@ -382,6 +383,10 @@ impl Storage for AzureBlobStorage {
382383

383384
#[instrument(name = "storage.azure.delete", level = "debug", skip(self))]
384385
async fn delete(&self, path: &Path) -> StorageResult<()> {
386+
// The Azure SDK has no batch delete, so bulk_delete also funnels through
387+
// here one blob at a time.
388+
crate::metrics::OBJECT_STORAGE_DELETE_REQUESTS_TOTAL.inc();
389+
let _timer = HistogramTimer::new(&crate::metrics::OBJECT_STORAGE_DELETE_REQUEST_DURATION);
385390
let blob_name = self.blob_name(path);
386391
let delete_res: Result<_, StorageError> = self
387392
.container_client

0 commit comments

Comments
 (0)