Skip to content

fix: route /victoriametrics writes through vmproxy (PMM-15030) - #5323

Merged
4nte merged 10 commits into
mainfrom
fix-pmm-15030
Jun 23, 2026
Merged

fix: route /victoriametrics writes through vmproxy (PMM-15030)#5323
4nte merged 10 commits into
mainfrom
fix-pmm-15030

Conversation

@theTibi

@theTibi theTibi commented May 5, 2026

Copy link
Copy Markdown
Contributor

PMM-15030

Summary

  • In external VictoriaMetrics mode (PMM_VM_URL set), nginx still proxied /victoriametrics/ to local 127.0.0.1:9090/prometheus/, causing write-path failures.
  • Route /victoriametrics/ through vmproxy (http://vmproxy/prometheus/) to align with /prometheus/api/v1 behavior.

Ticket

Test plan

  • Brought up PMM test stack with merged compose files (docker-compose.yml + docker-compose.dev.yml) and external VM mode configured.
  • Verified active config inside pmm-server:
    • location /victoriametrics/ { proxy_pass http://vmproxy/prometheus/; }
  • Ran nginx config validation in container:
    • docker exec pmm-server nginx -t -> syntax is ok and test is successful
  • Exercised write endpoint through PMM:
    • curl -k -u admin:admin -X POST https://127.0.0.1/victoriametrics/api/v1/write --data-binary testdata -> HTTP 204
  • pmm-submodules (FB) PR: fix-pmm-15030 (FB) Percona-Lab/pmm-submodules#4340

In external VictoriaMetrics mode, /victoriametrics/ still pointed to local 127.0.0.1:9090 and returned 502 for write requests. Route it through vmproxy to match /prometheus/api/v1 behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>

Signed-off-by: theTibi <tkorocz@gmail.com>
@theTibi
theTibi requested a review from a team as a code owner May 5, 2026 09:40
@theTibi
theTibi requested review from ademidoff and maxkondr and removed request for a team May 5, 2026 09:40
@codecov

codecov Bot commented May 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.53%. Comparing base (2478fef) to head (4418b2b).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5323      +/-   ##
==========================================
+ Coverage   43.50%   43.53%   +0.02%     
==========================================
  Files         413      413              
  Lines       42953    42953              
==========================================
+ Hits        18687    18699      +12     
+ Misses      22392    22380      -12     
  Partials     1874     1874              
Flag Coverage Δ
admin 34.78% <ø> (ø)
agent 49.14% <ø> (+0.11%) ⬆️
managed 42.84% <ø> (ø)
vmproxy 72.22% <ø> (ø)

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

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@CLAassistant

CLAassistant commented May 15, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@ondrejpatocka ondrejpatocka added the author:ai-agent Standalone AI agent contribution label May 18, 2026
@4nte
4nte self-requested a review June 1, 2026 11:47
@4nte
4nte self-requested a review June 1, 2026 11:59
@4nte
4nte requested a review from maxkondr June 5, 2026 13:40
@4nte
4nte requested a review from JiriCtvrtka June 11, 2026 12:48
# VictoriaMetrics
location /victoriametrics/ {
proxy_pass http://127.0.0.1:9090/prometheus/;
proxy_pass http://vmproxy/;

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.

Suggested change
proxy_pass http://vmproxy/;
proxy_pass http://vmproxy;

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.

@maxkondr Trailing slash is necessary here because it strips the /victoriametrics/ prefix from the request path, requests would fail without it

@ademidoff

Copy link
Copy Markdown
Member

@4nte Let's make sure is QA'd K8s )

@4nte
4nte merged commit 4ec160f into main Jun 23, 2026
30 checks passed
@4nte
4nte deleted the fix-pmm-15030 branch June 23, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:ai-agent Standalone AI agent contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants