Skip to content

Commit

Permalink
push.go: properly flush compressed metrics to pushURL
Browse files Browse the repository at this point in the history
  • Loading branch information
valyala committed Jul 25, 2022
1 parent b305bc0 commit fe970f4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions push.go
Expand Up @@ -133,6 +133,9 @@ func InitPushExt(pushURL string, interval time.Duration, extraLabels string, wri
if _, err := zw.Write(tmpBuf); err != nil {
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)
if err != nil {
log.Printf("ERROR: metrics.push: cannot initialize request for metrics push to %q: %s", pushURLRedacted, err)
Expand Down

0 comments on commit fe970f4

Please sign in to comment.