From 10e34c668faa0b614e94e466777585a24bdf5270 Mon Sep 17 00:00:00 2001 From: Frank Spitulski Date: Sun, 24 Feb 2019 15:15:35 -0800 Subject: [PATCH] fix(push): incorporate changes from review Signed-off-by: Frank Spitulski --- prometheus/push/push.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/prometheus/push/push.go b/prometheus/push/push.go index ccfca3a..6636ffc 100644 --- a/prometheus/push/push.go +++ b/prometheus/push/push.go @@ -186,8 +186,10 @@ func (p *Pusher) BasicAuth(username, password string) *Pusher { } // Format configures the Pusher to use an encoding format given by the -// provided expfmt.Format. For convenience, this method returns a -// pointer to the Pusher itself. +// provided expfmt.Format. The default format is expfmt.FmtProtoDelim and +// should be used with the standard Prometheus Pushgateway. Custom +// implementations may require different formats. For convenience, this +// method returns a pointer to the Pusher itself. func (p *Pusher) Format(format expfmt.Format) *Pusher { p.expfmt = format return p @@ -233,7 +235,7 @@ func (p *Pusher) push(method string) error { if p.useBasicAuth { req.SetBasicAuth(p.username, p.password) } - req.Header.Set(contentTypeHeader, string(expfmt.FmtProtoDelim)) + req.Header.Set(contentTypeHeader, string(p.expfmt)) resp, err := p.client.Do(req) if err != nil { return err