diff --git a/internal/cert/cert.go b/internal/cert/cert.go index af69067..0d66ada 100644 --- a/internal/cert/cert.go +++ b/internal/cert/cert.go @@ -76,7 +76,9 @@ func CollectMetrics(ctx context.Context, path string, cfg Config) (Metrics, erro if err != nil { return metrics, err } - metrics.Tags = map[string]string{"subject": cert.Subject.CommonName} + fixStar := strings.Replace(cert.Subject.CommonName, "*", "STAR", 1) + fixDot := strings.ReplaceAll(fixStar, ".", "_") + metrics.Tags = map[string]string{"subject": fixDot} if cfg.ServerName != "" { if err := cert.VerifyHostname(cfg.ServerName); err != nil { return metrics, fmt.Errorf("error supplied servername not valid for this certificate: %v", err)