Skip to content

Commit

Permalink
style: log
Browse files Browse the repository at this point in the history
  • Loading branch information
Brant-lzh committed Dec 19, 2023
1 parent 9f7a739 commit da523e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions collector/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ var (
mysqlScrapeDurationSeconds = prometheus.NewDesc(
prometheus.BuildFQName(namespace, exporter, "collector_duration_seconds"),
"Collector time duration.",
[]string{"collector"}, nil,
[]string{"collector"},
nil,
)
)

Expand Down Expand Up @@ -149,7 +150,7 @@ func (e *Exporter) scrape(ctx context.Context, ch chan<- prometheus.Metric) floa
db.SetConnMaxLifetime(1 * time.Minute)

if err := db.PingContext(ctx); err != nil {
level.Error(e.logger).Log("msg", "Error pinging mysqld", "err", err)
level.Error(e.logger).Log("msg", "Error pinging mysqld", "target", e.getTargetFromDsn(), "err", err)
return 0.0
}

Expand Down

0 comments on commit da523e0

Please sign in to comment.