Skip to content

Commit

Permalink
Workaround debug logging panic
Browse files Browse the repository at this point in the history
Using the key `source` in promslog causes it to panic due to
having a duplicate key for the `source` filename.

Fixes: #107

Signed-off-by: SuperQ <[email protected]>
  • Loading branch information
SuperQ committed Jan 8, 2025
1 parent c014fd8 commit 9192a2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion collector/sources.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (e Exporter) getSourcesMetrics(logger *slog.Logger, ch chan<- prometheus.Me
results := make([]chrony.ReplySourceData, sources.NSources)

for i := 0; i < int(sources.NSources); i++ {
logger.Debug("Fetching source", "source", i)
logger.Debug("Fetching source", "source_index", i)
packet, err = client.Communicate(chrony.NewSourceDataPacket(int32(i)))
if err != nil {
return fmt.Errorf("Failed to get sourcedata response: %d", i)
Expand Down

0 comments on commit 9192a2e

Please sign in to comment.