Skip to content

Commit

Permalink
Add more information to error logs (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
ribbybibby authored Sep 10, 2020
1 parent ac9bc31 commit ddedd5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ssl_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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,
)
Expand Down

0 comments on commit ddedd5f

Please sign in to comment.