Skip to content

[linstor] Fix swapped VMPodScrape job labels#2264

Merged
sircthulhu merged 1 commit intocozystack:mainfrom
sasha-sup:fix/linstor-podscrape-job-labels
Mar 27, 2026
Merged

[linstor] Fix swapped VMPodScrape job labels#2264
sircthulhu merged 1 commit intocozystack:mainfrom
sasha-sup:fix/linstor-podscrape-job-labels

Conversation

@sasha-sup
Copy link
Copy Markdown
Contributor

@sasha-sup sasha-sup commented Mar 25, 2026

What this PR does

Fixes swapped job labels in the cozy-linstor VictoriaMetrics VMPodScrape templates.

Before this change:

  • linstor-satellite metrics were relabeled as job=linstor-controller
  • linstor-controller metrics were relabeled as job=linstor-satellite

This caused linstorControllerOffline alerts to fire for satellite endpoints such as :9942 while reporting that the controller was unreachable.

After this change:

  • linstor-satellite metrics keep job=linstor-satellite
  • linstor-controller metrics keep job=linstor-controller

This restores consistent alerting and dashboard semantics for LINSTOR monitoring.

Release note

[linstor] Fix swapped VictoriaMetrics `VMPodScrape` job labels in `cozy-linstor` so `linstorControllerOffline` alerts target the controller instead of satellite endpoints.

Summary by CodeRabbit

  • Bug Fixes
    • Corrected Prometheus relabeling so Linstor controller and satellite scrapes now receive the correct job labels.
    • Ensures metrics are attributed to the proper components, improving accuracy of monitoring and alerting.

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Mar 25, 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 addresses a critical misconfiguration in the LINSTOR monitoring setup by correcting swapped job labels in the VictoriaMetrics VMPodScrape templates. This fix prevents misleading linstorControllerOffline alerts from targeting satellite endpoints and ensures that monitoring data is accurately attributed to the correct LINSTOR components. The change significantly improves the reliability and clarity of LINSTOR's operational insights and alerting mechanisms.

Highlights

  • Metric Label Correction: Fixed swapped job labels within the cozy-linstor VictoriaMetrics VMPodScrape templates, which previously misidentified linstor-satellite metrics as linstor-controller and vice-versa.
  • Alerting Accuracy: Resolved an issue where linstorControllerOffline alerts were incorrectly triggered for satellite endpoints due to the mislabeled metrics.
  • Monitoring Consistency: Ensured that linstor-satellite metrics now correctly retain job=linstor-satellite and linstor-controller metrics retain job=linstor-controller, restoring consistent alerting and dashboard semantics for LINSTOR monitoring.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

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.

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 modifies podscrape.yaml to adjust Prometheus scraping configurations. It swaps the job labels for two distinct relabelConfigs blocks: one now targets linstor-satellite instead of linstor-controller, and the other targets linstor-controller instead of linstor-satellite. A review comment suggests improving the regex used in the labeldrop action within both relabelConfigs blocks to prevent unintended label drops by anchoring the regex (e.g., ^(endpoint|namespace|pod|container)$).

- action: labeldrop
regex: (endpoint|namespace|pod|container)
- replacement: linstor-controller
- replacement: linstor-satellite
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

The regex on the preceding line for labeldrop is broad and could unintentionally drop labels that contain endpoint, namespace, pod, or container as substrings (e.g., pod_template_hash). To ensure only exact label names are matched, it's safer to anchor the regex.

A more robust regex would be ^(endpoint|namespace|pod|container)$.

This applies to the other relabelConfigs block in this file as well.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 62fa9d2c-debf-4001-930b-1b8f668cae2b

📥 Commits

Reviewing files that changed from the base of the PR and between 273b84a and bad5910.

📒 Files selected for processing (1)
  • packages/system/linstor/templates/podscrape.yaml
✅ Files skipped from review due to trivial changes (1)
  • packages/system/linstor/templates/podscrape.yaml

📝 Walkthrough

Walkthrough

Prometheus relabeling in a PodScrape template was corrected so each VMPodScrape assigns its matching job label: linstor-satellitejob: linstor-satellite, and linstor-controllerjob: linstor-controller. No selectors, endpoints, or other relabel rules changed.

Changes

Cohort / File(s) Summary
Prometheus Scrape Configuration
packages/system/linstor/templates/podscrape.yaml
Swapped the relabelConfigs that set the job label so each VMPodScrape assigns its matching job name; other relabel actions, selectors, ports, paths, schemes, and labels unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐇 I nudged the labels in the night,
Swapped their names until they fit just right.
Satellite hops, controller beams,
Metrics tidy in moonlit streams.
Hooray — the jobs are named by teams!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[linstor] Fix swapped VMPodScrape job labels' directly and accurately describes the main change: correcting incorrectly swapped job labels in the linstor VMPodScrape configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sircthulhu
Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor

@sircthulhu sircthulhu left a comment

Choose a reason for hiding this comment

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

lgtm

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 26, 2026
Signed-off-by: sasha-sup <alexsup4ik@gmail.com>
@sasha-sup sasha-sup force-pushed the fix/linstor-podscrape-job-labels branch from 273b84a to bad5910 Compare March 26, 2026 08:12
@sircthulhu sircthulhu added backport Should change be backported on previus release backport-previous labels Mar 26, 2026
@sircthulhu sircthulhu merged commit de540d8 into cozystack:main Mar 27, 2026
11 checks passed
@github-actions
Copy link
Copy Markdown

Successfully created backport PR for release-1.0:

@github-actions
Copy link
Copy Markdown

Successfully created backport PR for release-1.1:

sircthulhu added a commit that referenced this pull request Mar 27, 2026
sircthulhu added a commit that referenced this pull request Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Should change be backported on previus release backport-previous bug Something isn't working lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants