push.go: properly flush compressed metrics to pushURL
This commit is contained in:
parent
b305bc011e
commit
fe970f4df0
3
push.go
3
push.go
@ -133,6 +133,9 @@ func InitPushExt(pushURL string, interval time.Duration, extraLabels string, wri
|
|||||||
if _, err := zw.Write(tmpBuf); err != nil {
|
if _, err := zw.Write(tmpBuf); err != nil {
|
||||||
panic(fmt.Errorf("BUG: cannot write %d bytes to gzip writer: %s", len(tmpBuf), err))
|
panic(fmt.Errorf("BUG: cannot write %d bytes to gzip writer: %s", len(tmpBuf), err))
|
||||||
}
|
}
|
||||||
|
if err := zw.Close(); err != nil {
|
||||||
|
panic(fmt.Errorf("BUG: cannot flush metrics to gzip writer: %s", err))
|
||||||
|
}
|
||||||
req, err := http.NewRequest("GET", pushURL, &bb)
|
req, err := http.NewRequest("GET", pushURL, &bb)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("ERROR: metrics.push: cannot initialize request for metrics push to %q: %s", pushURLRedacted, err)
|
log.Printf("ERROR: metrics.push: cannot initialize request for metrics push to %q: %s", pushURLRedacted, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user