Skip to content

Commit

Permalink
Fix separation of multiple prometheus_client outputs (influxdata#3570)
Browse files Browse the repository at this point in the history
(cherry picked from commit 8484de6)
  • Loading branch information
danielnelson authored and charless-splunk committed Jun 19, 2018
1 parent 0d319f5 commit e06ee22
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/outputs/prometheus_client/prometheus_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ var sampleConfig = `
string_as_label = true
`

<<<<<<< HEAD
func (p *PrometheusClient) basicAuth(h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if p.BasicUsername != "" && p.BasicPassword != "" {
Expand All @@ -114,6 +115,8 @@ func (p *PrometheusClient) basicAuth(h http.Handler) http.Handler {
})
}

=======
>>>>>>> Fix separation of multiple prometheus_client outputs (#3570)
func (p *PrometheusClient) Start() error {
defaultCollectors := map[string]bool{
"gocollector": true,
Expand Down Expand Up @@ -146,8 +149,13 @@ func (p *PrometheusClient) Start() error {
}

mux := http.NewServeMux()
<<<<<<< HEAD
mux.Handle(p.Path, p.basicAuth(promhttp.HandlerFor(
registry, promhttp.HandlerOpts{ErrorHandling: promhttp.ContinueOnError})))
=======
mux.Handle(p.Path, promhttp.HandlerFor(
registry, promhttp.HandlerOpts{ErrorHandling: promhttp.ContinueOnError}))
>>>>>>> Fix separation of multiple prometheus_client outputs (#3570)

p.server = &http.Server{
Addr: p.Listen,
Expand Down

0 comments on commit e06ee22

Please sign in to comment.