Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

Type of Change

  • New feature

Description

  • Feature / Bug Fix: Added operation count tracking via OpenTelemetry for all Azure Storage REST API calls to enable monitoring of operation distribution, performance analysis, and cost tracking.

Implementation

Added RecordOperation() calls to 30+ operations across the azstorage component:

High-level operations (azstorage.go):

  • Directory: CreateDir, DeleteDir, RenameDir, ReadDir, StreamDir
  • File: CreateFile, OpenFile, DeleteFile, RenameFile
  • I/O: ReadFile, ReadInBuffer, WriteFile, CopyToFile, CopyFromFile
  • Metadata: GetAttr (GetProperties), Chmod, Chown
  • Advanced: TruncateFile, FlushFile, GetFileBlockOffsets
  • Blocks: StageData, CommitData, GetCommittedBlockList
  • Symlinks: CreateLink, ReadLink

Low-level operations (block_blob.go):

  • List, StageBlock, CommitBlocks, GetCommittedBlockList

Metric exported:

blobfuse_operations_total{operation, component}

Example queries:

# Top operations
topk(10, sum(rate(blobfuse_operations_total[5m])) by (operation))

# Read vs write ratio
sum(rate(blobfuse_operations_total{operation=~"Read.*|GetAttr"}[5m])) /
sum(rate(blobfuse_operations_total{operation=~"Write.*|Create.*"}[5m]))

# Block operations rate
sum(rate(blobfuse_operations_total{operation=~".*Block.*|Stage.*|Commit.*"}[5m]))

Documentation updates:

  • Added operation metrics section to doc/metrics.md
  • Included Prometheus queries for operation analysis
  • Added alerting examples for unusual patterns

How Has This Been Tested?

  • Component builds successfully with go build -tags=unittest ./component/azstorage/...
  • All existing tests pass
  • Metrics integration follows existing patterns from cache and Azure request metrics

Checklist

  • The purpose of this PR is explained in this or a referenced issue.
  • Tests are included and/or updated for code changes.
  • Documentation update required.
  • Updates to module CHANGELOG.md are included.
  • License headers are included in each file.

Related Links

  • Builds on existing OpenTelemetry metrics infrastructure from previous PRs
  • Complements Azure Storage request/response/error metrics already in place

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Add meaningful metrics for resource usage and operations Add OpenTelemetry metrics export for cache, storage, and system monitoring Jan 16, 2026
Copilot AI requested a review from vibhansa-msft January 16, 2026 07:07
Copilot AI changed the title Add OpenTelemetry metrics export for cache, storage, and system monitoring Add OpenTelemetry metrics tracking for Azure Storage API calls Jan 16, 2026
Copilot AI changed the title Add OpenTelemetry metrics tracking for Azure Storage API calls Add OpenTelemetry operation count metrics for all Azure Storage operations Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants