Promreg allows invalid targets to be registered

Bug #1722774 reported by Jacek Nykis
14
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://promreg.example.com:12321/targets/host.example.com:9103/metrics

It will accept the data and write config similar to:
- targets:
  - host.example.com:9103/metrics
  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

Jacek Nykis (jacekn)
Changed in prometheus-registration:
assignee: nobody → Jacek Nykis (jacekn)
Tom Haddon (mthaddon)
Changed in prometheus-registration:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.