amimof / node-cert-exporter

An SSL certificate Prometheus exporter
Apache License 2.0
172 stars 34 forks source link

Outdated version of prometheus/client_golang generating warnings #83

Closed rafaelmagu closed 8 months ago

rafaelmagu commented 1 year ago

Description The binary is generating many warnings about attempting to write headers after the body of a request has been written when serving metrics to Prometheus' scrapers.

http: superfluous response.WriteHeader call from github.com/prometheus/client_golang/prometheus/promhttp.(*responseWriterDelegator).WriteHeader (delegator.go:59)
http: superfluous response.WriteHeader call from github.com/prometheus/client_golang/prometheus/promhttp.(*responseWriterDelegator).WriteHeader (delegator.go:59)
http: superfluous response.WriteHeader call from github.com/prometheus/client_golang/prometheus/promhttp.(*responseWriterDelegator).WriteHeader (delegator.go:59)

Steps to reproduce the issue:

  1. Download latest (as of this writing, 1.1.4) linux-amd64 binary
  2. Run it
  3. Watch the logs

Describe the results you received: Service logs (I'm running it as a daemon through SystemD) are full of warnings.

Describe the results you expected: No warnings about headers being written after the body.

Additional information: This issue has been fixed upstream back in early 2020 at https://github.com/prometheus/client_golang/commit/586178b4ab42bbe57811049a16f1aae5d164feb8, subsequently released in https://github.com/prometheus/client_golang/releases/tag/v1.5.1

I believe the version you currently have pinned in go.mod is too old.

Output of node-cert-exporter --version:

Version: v1.1.4
Commit: 7c8e3f8df55a710984280e5893d278b90262303f
Branch: HEAD
GoVersion: 1.20.4

Additional environment details: Ubuntu Focal, amd64 arch, AWS instance.

amimof commented 8 months ago

client_golang/prometheus has been bumped (along with other packages) in the latest release. Check it out and let me know what you think