-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(metrics): get recurringjob label from status field instead of to… #3216
feat(metrics): get recurringjob label from status field instead of to… #3216
Conversation
📝 WalkthroughWalkthroughThe changes involve a modification to the Changes
Sequence Diagram(s)sequenceDiagram
participant BackupCollector
participant Backup
participant Metrics
BackupCollector->>Backup: Collect()
Backup->>BackupCollector: Retrieve Status.Labels
BackupCollector->>Metrics: Collect metrics using Status.Labels
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
4bb0d22
to
d89ca20
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
metrics_collector/backup_collector.go (1)
82-82
: Approved: Label retrieval change looks good. Consider adding error handling.The change from
backup.Labels
tobackup.Status.Labels
for retrieving the recurring job name aligns with the PR objectives and addresses the issues mentioned in PR #3034 and issue #9429. This modification should improve the accuracy of the metrics collected for backups.Consider adding error handling for cases where the label might not exist:
-backupRecurringJobName := backup.Status.Labels[types.RecurringJobLabel] +backupRecurringJobName, ok := backup.Status.Labels[types.RecurringJobLabel] +if !ok { + bc.logger.Warn("Recurring job label not found in backup status") +}This addition would make the code more robust and provide useful logging for debugging purposes.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (1)
- metrics_collector/backup_collector.go (1 hunks)
🧰 Additional context used
🔇 Additional comments (1)
metrics_collector/backup_collector.go (1)
82-84
: Verify metrics reporting and consider additional testing.While the change looks good, it's important to ensure that the metrics are correctly reported with this modification.
Please run the following script to check if the metrics are still being reported correctly:
Additionally, consider adding or updating unit tests to cover this change in label retrieval.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Signed-off-by: Yvan <[email protected]>
d89ca20
to
8e22cd8
Compare
Which issue(s) this PR fixes:
Correcting implementation issue on #3034
Issue longhorn/longhorn#9429 (comment)
What this PR does / why we need it:
After testing from @longhorn/qa I corrected the source of label data to the one set in the test results
Special notes for your reviewer:
N/A
Additional documentation or context
N/A