Skip to content

[receiver/httpcheck] RecordHttpcheckTLSCertRemainingDataPoint is called twice per scrape causing duplicate metrics #47740

@himanshu130700

Description

@himanshu130700

Component(s)

receiver/httpcheck

What happened?

In scraper.go, RecordHttpcheckTLSCertRemainingDataPoint is invoked twice within
the same scrape goroutine for every HTTPS endpoint:

  • First call: lines 353–366 (inside the mux.Lock() block, before timing metrics)
  • Second call: lines 404–417 (later in the same block)

Both blocks extract TLS info from resp.TLS and record the data point, resulting in
duplicate metric emissions per scrape cycle.

Steps to Reproduce

  1. Configure httpcheckreceiver targeting an HTTPS endpoint
  2. Enable httpcheck.tls.cert_remaining metric
  3. Observe duplicate data points emitted per scrape

Expected Result

httpcheck.tls.cert_remaining is recorded exactly once per endpoint per scrape.

Actual Result

It is recorded twice, producing duplicate data points.

Additional context

Fix is straightforward — remove the first duplicate block (lines 353–366).

Collector version

v0.150.0

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingreceiver/httpcheckHTTP Check receiver

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions