You've already forked ssl_exporter
mirror of
https://github.com/ribbybibby/ssl_exporter.git
synced 2025-07-12 23:50:14 +02:00
Add more information to error logs (#49)
This commit is contained in:
@ -75,7 +75,7 @@ func (e *Exporter) Collect(ch chan<- prometheus.Metric) {
|
||||
|
||||
state, err := e.prober(e.target, e.module, e.timeout)
|
||||
if err != nil {
|
||||
log.Errorln(err)
|
||||
log.Errorf("error=%s target=%s prober=%s timeout=%s", err, e.target, e.module.Prober, e.timeout)
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
tlsConnectSuccess, prometheus.GaugeValue, 0,
|
||||
)
|
||||
@ -90,7 +90,7 @@ func (e *Exporter) Collect(ch chan<- prometheus.Metric) {
|
||||
// Retrieve certificates from the connection state
|
||||
peerCertificates := state.PeerCertificates
|
||||
if len(peerCertificates) < 1 {
|
||||
log.Errorln("No certificates found in connection state for " + e.target)
|
||||
log.Errorf("error=No certificates found in connection state. target=%s prober=%s", e.target, e.module.Prober)
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
tlsConnectSuccess, prometheus.GaugeValue, 0,
|
||||
)
|
||||
|
Reference in New Issue
Block a user