Skip to content

Commit

Permalink
Merge pull request #14 from Depado/logrus_fix
Browse files Browse the repository at this point in the history
Fixing logrus and adding comments
  • Loading branch information
zsais authored Oct 1, 2017
2 parents fdf57ad + d926c71 commit bdee3a8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
log "github.com/Sirupsen/logrus"
log "github.com/sirupsen/logrus"
)

var defaultMetricPath = "/metrics"
Expand Down Expand Up @@ -66,7 +66,7 @@ func (p *Prometheus) SetPushGateway(pushGatewayURL, metricsURL string, pushInter
p.startPushTicker()
}

// Set pushgateway job name, defaults to "gin"
// SetPushGatewayJob job name, defaults to "gin"
func (p *Prometheus) SetPushGatewayJob(j string) {
p.Ppg.Job = j
}
Expand Down Expand Up @@ -116,7 +116,7 @@ func (p *Prometheus) getMetrics() []byte {
return body
}

func (p *Prometheus) getPushGatewayUrl() string {
func (p *Prometheus) getPushGatewayURL() string {
h, _ := os.Hostname()
if p.Ppg.Job == "" {
p.Ppg.Job = "gin"
Expand All @@ -125,7 +125,7 @@ func (p *Prometheus) getPushGatewayUrl() string {
}

func (p *Prometheus) sendMetricsToPushGateway(metrics []byte) {
req, err := http.NewRequest("POST", p.getPushGatewayUrl(), bytes.NewBuffer(metrics))
req, err := http.NewRequest("POST", p.getPushGatewayURL(), bytes.NewBuffer(metrics))
client := &http.Client{}
_, err = client.Do(req)
if err != nil {
Expand Down

0 comments on commit bdee3a8

Please sign in to comment.