fix: route /victoriametrics writes through vmproxy (PMM-15030) - #5323
Merged
Conversation
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
requested review from
ademidoff and
maxkondr
and removed request for
a team
May 5, 2026 09:40
1 task
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
maxkondr
approved these changes
May 6, 2026
4nte
self-requested a review
June 1, 2026 11:47
4nte
approved these changes
Jun 1, 2026
4nte
self-requested a review
June 1, 2026 11:59
4nte
approved these changes
Jun 5, 2026
maxkondr
reviewed
Jun 11, 2026
| # VictoriaMetrics | ||
| location /victoriametrics/ { | ||
| proxy_pass http://127.0.0.1:9090/prometheus/; | ||
| proxy_pass http://vmproxy/; |
Contributor
There was a problem hiding this comment.
Suggested change
| proxy_pass http://vmproxy/; | |
| proxy_pass http://vmproxy; |
Contributor
There was a problem hiding this comment.
@maxkondr Trailing slash is necessary here because it strips the /victoriametrics/ prefix from the request path, requests would fail without it
ademidoff
approved these changes
Jun 11, 2026
Member
|
@4nte Let's make sure is QA'd K8s ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PMM-15030
Summary
PMM_VM_URLset), nginx still proxied/victoriametrics/to local127.0.0.1:9090/prometheus/, causing write-path failures./victoriametrics/throughvmproxy(http://vmproxy/prometheus/) to align with/prometheus/api/v1behavior.Ticket
Test plan
docker-compose.yml+docker-compose.dev.yml) and external VM mode configured.pmm-server:location /victoriametrics/ { proxy_pass http://vmproxy/prometheus/; }docker exec pmm-server nginx -t->syntax is okandtest is successfulcurl -k -u admin:admin -X POST https://127.0.0.1/victoriametrics/api/v1/write --data-binary testdata-> HTTP204