Skip to content

Commit

Permalink
feat: expose perf metric counter description and units
Browse files Browse the repository at this point in the history
Fixes #1379
  • Loading branch information
rahulguptajss committed Dec 7, 2022
1 parent 3cfce9c commit e5b056d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions cmd/exporters/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,10 @@ func (p *Prometheus) render(data *matrix.Matrix) ([][]byte, error) {

var description string
if metric.GetDescription() != "" {
description = " COUNTER: " + metric.GetDescription() + " UNIT: " + metric.GetUnit()
description = " COUNTER: " + metric.GetDescription()
}
if metric.GetUnit() != "" {
description = description + " UNIT: " + metric.GetUnit()
}
// metric is array, determine if this is a plain array or histogram
if metric.HasLabels() {
Expand Down Expand Up @@ -491,7 +494,10 @@ func (p *Prometheus) render(data *matrix.Matrix) ([][]byte, error) {
objectMetric := data.Object + "_" + metric.GetName()
var description string
if metric.GetDescription() != "" {
description = " COUNTER: " + metric.GetDescription() + " \\nUNIT: " + metric.GetUnit()
description = " COUNTER: " + metric.GetDescription()
}
if metric.GetUnit() != "" {
description = description + " UNIT: " + metric.GetUnit()
}
_, ok := normalizedLabels[objectMetric]
if !ok {
Expand Down

0 comments on commit e5b056d

Please sign in to comment.