Skip to content

Commit 6eff834

Browse files
committed
fix prometheus error
Signed-off-by: Markus Blaschke <mblaschke82@gmail.com>
1 parent 3424ac8 commit 6eff834

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

janitor/janitor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ func (j *Janitor) checkAzureResourceExpiry(logger *log.Entry, resourceType, reso
397397
resourceTagRewriteNeeded = true
398398
resourceExpireTime = val
399399
} else {
400-
logger.Errorf("ERROR %s", timeParseErr.Error())
400+
logger.Errorf("unable to parse time: %v", timeParseErr.Error())
401401
}
402402
}
403403

janitor/resourcegroups.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ func (j *Janitor) runResourceGroups(ctx context.Context, logger *log.Entry, subs
5454
resourceLogger.Infof("successfully updated")
5555
} else {
5656
// failed delete
57-
resourceLogger.Errorf("ERROR %s", err.Error())
57+
resourceLogger.Error(err.Error())
5858

5959
j.Prometheus.MetricErrors.With(prometheus.Labels{
60-
"resourceType": stringToStringLower(resourceType),
60+
"subscriptionID": stringPtrToStringLower(subscription.SubscriptionID),
61+
"resourceType": stringToStringLower(resourceType),
6162
}).Inc()
6263
}
6364
}

0 commit comments

Comments
 (0)