Skip to content

Commit

Permalink
Merge pull request #17 from francois-maillard/master
Browse files Browse the repository at this point in the history
Support for = in query string
  • Loading branch information
warmans authored Jun 22, 2020
2 parents ac32971 + 3f63cb8 commit 2ad8c4b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,8 @@ the metrics will rather look like:

http_requests_total{method="post",code="200",instance="histo1"} 1027 1395066363000
#### Target URL containing a `=` character

In case one of your target urls contains a `=` character (for instance consul agent's exporter is available at `/v1/agent/metrics?format=prometheus`), you **must** use the custom labelling notation:

bin/prometheus-aggregate-exporter -targets="consul=http://localhost:8500/v1/agent/metrics?format=prometheus"
4 changes: 2 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ func (f *Aggregator) fetch(target string, resultChan chan *Result) {
s := strings.Split(target, "=")
url := s[0]
name := s[0]
if len(s) == 2 {
url = s[1]
if len(s) > 1 {
url = strings.Join(s[1:], "=")
}

startTime := time.Now()
Expand Down

0 comments on commit 2ad8c4b

Please sign in to comment.