Promreg allows invalid targets to be registered
Bug #1722774 reported by
Jacek Nykis
This bug affects 2 people
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| Prometheus Registration |
Fix Committed
|
Undecided
|
Jacek Nykis | ||
Bug Description
If we call promreg like this:
curl -vH 'AuthToken: REDACTED' -d '{"comment": "Adding staging", "labels": {"stage": "staging"}}'
http://
It will accept the data and write config similar to:
- targets:
- host.example.
labels:
stage: staging
Above is incorrect, targets must be host:port and can't contain URI
Simple solution is to just reject the data but in the long term it would be good to support custom metric paths correctly.
Related branches
~jacekn/prometheus-registration/+git/prometheus-registration:master
- Joel Sing (community): Approve (+1)
- Jacek Nykis (community): Needs Resubmitting
-
Diff: 199 lines (+64/-21)5 files modifiedREADME.md (+4/-1)
debian/changelog (+6/-0)
promreg/http.go (+12/-0)
promreg/promreg_test.go (+41/-19)
snapcraft.yaml (+1/-1)
| Changed in prometheus-registration: | |
| assignee: | nobody → Jacek Nykis (jacekn) |
| Changed in prometheus-registration: | |
| status: | New → Fix Committed |
To post a comment you must log in.