Skip to content

Commit

Permalink
feat: add better naming of category and audit scores
Browse files Browse the repository at this point in the history
  • Loading branch information
smartinov committed Dec 5, 2018
1 parent be07af5 commit 3875229
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,10 @@ func collectLighthouseResults(prefix string, lhr *pagespeedonline.LighthouseResu
}

ch <- prometheus.MustNewConstMetric(
prometheus.NewDesc(fqname(prefix, k, "score"), v.Description, nil, constLabels),
prometheus.NewDesc(fqname(prefix, "category_score"), v.Description, []string{"category"}, constLabels),
prometheus.GaugeValue,
score)
score,
k)
}

for k, v := range lhr.Audits {
Expand All @@ -143,9 +144,10 @@ func collectLighthouseResults(prefix string, lhr *pagespeedonline.LighthouseResu
}

ch <- prometheus.MustNewConstMetric(
prometheus.NewDesc(fqname(prefix, "audit", k, "score"), v.Description, nil, constLabels),
prometheus.NewDesc(fqname(prefix, "audit_score"), "Lighthouse audit scores", []string{"audit"}, constLabels),
prometheus.GaugeValue,
score)
score,
k)
}
}

Expand Down

0 comments on commit 3875229

Please sign in to comment.