Skip to content

vmagent: support per remoteWrite queues configuration#2139

Open
AndrewChubatiuk wants to merge 1 commit intomasterfrom
per-rw-queues
Open

vmagent: support per remoteWrite queues configuration#2139
AndrewChubatiuk wants to merge 1 commit intomasterfrom
per-rw-queues

Conversation

@AndrewChubatiuk
Copy link
Copy Markdown
Contributor

@AndrewChubatiuk AndrewChubatiuk commented May 6, 2026

fixes #2138


Summary by cubic

Adds per-remoteWrite queues configuration to VMAgent, letting you set different queue counts per remote write target with fallback to the global setting.

  • New Features
    • Added queues to VMAgentRemoteWriteSpec; CRD and docs updated.
    • Controller builds -remoteWrite.queues per URL; if any per-target is set, emits a list; otherwise uses remoteWriteSettings.queues.

Written for commit 12c7c04. Summary will update on new commits.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 10 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="internal/controller/operator/factory/vmagent/vmagent.go">

<violation number="1" location="internal/controller/operator/factory/vmagent/vmagent.go:1030">
P1: `hasAnyQueuesSet` is set too broadly, which can drop `-remoteWrite.queues` entirely when explicit per-URL values equal the global queue value.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

}
if rw.Queues != nil {
queuesPerRW = append(queuesPerRW, strconv.Itoa(int(*rw.Queues)))
hasAnyQueuesSet = true
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot May 6, 2026

Choose a reason for hiding this comment

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

P1: hasAnyQueuesSet is set too broadly, which can drop -remoteWrite.queues entirely when explicit per-URL values equal the global queue value.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At internal/controller/operator/factory/vmagent/vmagent.go, line 1030:

<comment>`hasAnyQueuesSet` is set too broadly, which can drop `-remoteWrite.queues` entirely when explicit per-URL values equal the global queue value.</comment>

<file context>
@@ -1017,6 +1025,12 @@ func buildRemoteWriteArgs(cr *vmv1beta1.VMAgent, ac *build.AssetsCache) ([]strin
 			}
+			if rw.Queues != nil {
+				queuesPerRW = append(queuesPerRW, strconv.Itoa(int(*rw.Queues)))
+				hasAnyQueuesSet = true
+			} else {
+				queuesPerRW = append(queuesPerRW, queues)
</file context>
Fix with Cubic

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

there's no need in per url values in this case

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.

Got it, thanks for clarifying.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Setting different queues for each remoteWrite in VMAgent CR

2 participants