Skip to content

Commit 5637156

Browse files
committed
fix: prevent duplicate metrics
fixes #82 Metrics were initialized without normalizing the URLs.
1 parent 66ec7cf commit 5637156

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

internal/certificatetransparency/ct-watcher.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func (w *Watcher) addNewlyAvailableLogs(logList loglist3.LogList) {
158158
ctIndex: lastCTIndex,
159159
}
160160
w.workers = append(w.workers, &ctWorker)
161-
metrics.Init(operator.Name, transparencyLog.URL)
161+
metrics.Init(operator.Name, normalizeCtlogURL(transparencyLog.URL))
162162

163163
// Start a goroutine for each worker
164164
go func() {
@@ -269,7 +269,7 @@ func (w *Watcher) CreateIndexFile(filePath string) error {
269269
// Iterate over each log of the operator
270270
for _, transparencyLog := range operator.Logs {
271271
// Check if the log is already being watched
272-
metrics.Init(operator.Name, transparencyLog.URL)
272+
metrics.Init(operator.Name, normalizeCtlogURL(transparencyLog.URL))
273273
log.Println("Fetching STH for", transparencyLog.URL)
274274

275275
hc := http.Client{Timeout: 5 * time.Second}

0 commit comments

Comments
 (0)