Skip to content

feat(metrics): Adding streaming write fallback count metric#4630

Open
thrivikram-karur-g wants to merge 3 commits intomasterfrom
vikram-fs-streaming-write-fallback-metric
Open

feat(metrics): Adding streaming write fallback count metric#4630
thrivikram-karur-g wants to merge 3 commits intomasterfrom
vikram-fs-streaming-write-fallback-metric

Conversation

@thrivikram-karur-g
Copy link
Copy Markdown
Contributor

Description

Adding streaming write fallback metrics that tracks the reason for the fallback and also which file mode & flag it fell back to staging writes. Useful for understanding why streaming writes fallback hasn't been picked .

Link to the issue in case of a bug fix.

b/499889281

Testing details

  1. Manual - NA
  2. Unit tests - NA
  3. Integration tests - NA

Any backward incompatible change? If so, please explain.

N/A

@thrivikram-karur-g thrivikram-karur-g requested a review from a team as a code owner April 17, 2026 01:56
@github-actions github-actions bot added the remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR. label Apr 17, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces observability into the streaming write fallback mechanism within the file system. By adding a new counter metric, it enables better monitoring and analysis of why streaming writes may not be utilized, helping to identify performance bottlenecks or configuration issues related to write operations.

Highlights

  • New Metric Added: Introduced the 'fs/streaming_write_fallback_count' metric to track occurrences where streaming writes fall back to legacy staged writes.
  • Fallback Reason Tracking: Implemented detailed tracking for various fallback reasons, including out-of-order writes, existing files, concurrent limit breaches, and configuration settings.
  • Open Mode Context: Added support for recording the file's open mode (e.g., read-write, write-only) alongside the fallback reason to provide better context for debugging.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@thrivikram-karur-g thrivikram-karur-g removed the request for review from abhishek10004 April 17, 2026 01:56
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new metric, fs/streaming_write_fallback_count, to track when the system falls back from streaming writes to legacy staged writes. The changes include updating the FileInode struct and its methods to record these fallbacks with specific reasons such as out-of-order writes, concurrent limits, or existing files. Additionally, the metrics package was updated with new types, constants, and OTel test coverage. One review comment points out a discrepancy in the documentation where the metric is described as a 'cumulative distribution' despite being defined as a counter in the YAML configuration.

Comment thread internal/fs/inode/file.go
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.70%. Comparing base (8a9f498) to head (7c2690d).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
internal/fs/inode/file.go 96.42% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4630      +/-   ##
==========================================
+ Coverage   83.64%   83.70%   +0.06%     
==========================================
  Files         164      164              
  Lines       20272    20439     +167     
==========================================
+ Hits        16956    17109     +153     
- Misses       2676     2690      +14     
  Partials      640      640              
Flag Coverage Δ
unittests 83.70% <96.77%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

remind-reviewers Auto remind reviewers in attention set for review post 24hrs of inactivity on PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant