Skip to content

feat: report storage type and storage mode [backport #959] - #960

Merged
kalbasit merged 1 commit into
release-0.9from
backport-959-to-release-0.9
Feb 22, 2026
Merged

kalbasit merged 1 commit into
release-0.9from
backport-959-to-release-0.9

Conversation

@kalbasit

Copy link
Copy Markdown
Owner

Bot-based backport to release-0.9, triggered by a label in #959.

Report the storage type (local or s3) and storage mode (cdc or whole) in
public analytics and internal metrics.

Report the storage type (local or s3) and storage mode (cdc or whole) in
public analytics and internal metrics.

(cherry picked from commit 5f72e8b)
@kalbasit
kalbasit enabled auto-merge (squash) February 22, 2026 09:07
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. documentation Improvements or additions to documentation enhancement New feature or request labels Feb 22, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @kalbasit, 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 new attributes to the system's public analytics and internal metrics, specifically detailing the storage type and mode in use. This enhancement provides valuable operational insights into how the system is deployed and configured, aiding in monitoring and troubleshooting efforts without altering core functionality.

Highlights

  • Analytics and Metrics: Enhanced analytics and internal metrics by adding ncps.storage_type (local or s3) and ncps.storage_mode (cdc or whole) attributes, providing deeper insights into storage configurations.
Changelog
  • docs/docs/User Guide/Configuration/Analytics.md
    • Documented the new ncps.storage_mode attribute.
    • Documented the new ncps.storage_type attribute.
    • Reordered the ncps.cluster_uuid attribute entry.
  • pkg/ncps/serve.go
    • Implemented detection for local or S3 storage type.
    • Added ncps.storage_type attribute to resource attributes based on detected storage.
    • Implemented detection for CDC or whole storage mode.
    • Added ncps.storage_mode attribute to resource attributes based on detected mode.
Activity
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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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. ↩

@dosubot

dosubot Bot commented Feb 22, 2026

Copy link
Copy Markdown

Related Documentation

Checked 6 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

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

Copy link
Copy Markdown
Contributor

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 adds analytics attributes for storage type (local or s3) and storage mode (cdc or whole). The changes correctly detect these configurations and update the analytics documentation. The implementation is straightforward and looks correct. I have one suggestion to improve maintainability by replacing magic strings with constants, following the existing pattern in the file, which aligns with the project's consistency rule.

Comment thread pkg/ncps/serve.go
Comment on lines +1047 to +1058
if localDataPath != "" {
attrs = append(attrs, attribute.String("ncps.storage_type", "local"))
} else if s3Cfg != nil {
attrs = append(attrs, attribute.String("ncps.storage_type", "s3"))
}

// 5. Add storage mode
if cmd.Bool("cache-cdc-enabled") {
attrs = append(attrs, attribute.String("ncps.storage_mode", "cdc"))
} else {
attrs = append(attrs, attribute.String("ncps.storage_mode", "whole"))
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

To improve maintainability and avoid magic strings, it's a good practice to define constants for attribute values like "local", "s3", "cdc", and "whole". You can define them at the file level, similar to lockBackendLocal and lockBackendRedis.

For example, you could add these constants near the top of the file:

const (
	storageTypeLocal = "local"
	storageTypeS3    = "s3"
	storageModeCDC   = "cdc"
	storageModeWhole = "whole"
)

And then use them in this function:

if localDataPath != "" {
	attrs = append(attrs, attribute.String("ncps.storage_type", storageTypeLocal))
} else if s3Cfg != nil {
	attrs = append(attrs, attribute.String("ncps.storage_type", storageTypeS3))
}

// 5. Add storage mode
if cmd.Bool("cache-cdc-enabled") {
	attrs = append(attrs, attribute.String("ncps.storage_mode", storageModeCDC))
} else {
	attrs = append(attrs, attribute.String("ncps.storage_mode", storageModeWhole))
}
References
  1. Prioritize consistency with existing code patterns within the project over adopting alternative patterns, even if those alternatives are also valid. This comment suggests defining constants for magic strings, following the existing pattern of lockBackendLocal and lockBackendRedis within the file.

@github-actions

Copy link
Copy Markdown
Contributor

@codecov

codecov Bot commented Feb 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 5.04%. Comparing base (c26a8f7) to head (e17cfd1).
⚠️ Report is 1 commits behind head on release-0.9.

Additional details and impacted files
@@             Coverage Diff             @@
##           release-0.9    #960   +/-   ##
===========================================
  Coverage         5.04%   5.04%           
===========================================
  Files                6       6           
  Lines              436     436           
===========================================
  Hits                22      22           
  Misses             410     410           
  Partials             4       4           

☔ 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.

@kalbasit
kalbasit disabled auto-merge February 22, 2026 12:33
@kalbasit
kalbasit merged commit 54a3a18 into release-0.9 Feb 22, 2026
13 checks passed
@kalbasit
kalbasit deleted the backport-959-to-release-0.9 branch February 22, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant