open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.09k stars 2.38k forks source link

[receiver/httpcheck] Report certificate information #35968

Open atoulme opened 3 weeks ago

atoulme commented 3 weeks ago

Component(s)

receiver/httpcheck

Is your feature request related to a problem? Please describe.

The httpcheckreceiver can be used to perform periodic checks of a HTTP endpoint. The receiver can be enhanced to report certificate information as well.

Describe the solution you'd like

Ideally, the solution should match the metric and method used by the tlscheckreceiver. https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/tlscheckreceiver

Describe alternatives you've considered

No response

Additional context

No response

github-actions[bot] commented 3 weeks ago

Pinging code owners:

github-actions[bot] commented 3 weeks ago

Pinging code owners for receiver/httpcheck: @codeboten. See Adding Labels via Comments if you do not have permissions to add labels yourself.

StephanSalas commented 3 weeks ago

I think this could be very useful as both a conditional and optional set of metrics.

E.g. The metrics are only reported for "https" protocol, and only if the user turns it on.

I do wonder if we can approximately copy the metrics enumeration elastic has made:

  1. http_cert_status
  2. http_cert_cname
  3. http_cert_issuedby
  4. http_cert_validuntil
  5. http_cert_age
  6. http_cert_fingerprints
atoulme commented 2 weeks ago

These are dimensions to metrics, looks like. My proposal is to match what tlscheck receiver offers.

StephanSalas commented 2 weeks ago

These are dimensions to metrics, looks like. My proposal is to match what tlscheck receiver offers.

Not a bad convention... I think a limited set of metric dimentions to start may be easier / more minimal.

I wouldn't mind taking a stab at this one... it is quite interesting that we have:

  1. TLSCheck
  2. HttpCheck

As separate components, when this proposal kind of combines the TLSCheck functionality (sort of) with HttpCheck. It seems to be like we could potentially re-use some of the TLSCheck code. I will contemplate some options there...