Skip to content

Commit

Permalink
fix: analysis with multiple metrics (#1261)
Browse files Browse the repository at this point in the history
Signed-off-by: hari rongali <hari_rongali@intuit.com>
  • Loading branch information
harikrongali authored Jun 9, 2021
1 parent 79739fd commit 3929fb9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion controller/metrics/analysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ func collectAnalysisTemplate(ch chan<- prometheus.Metric, namespace, name string

for _, metric := range at.Metrics {
metricType := metricproviders.Type(metric)
addGauge(MetricAnalysisTemplateMetricInfo, 1, metricType)
addGauge(MetricAnalysisTemplateMetricInfo, 1, metricType, metric.Name)
}
}
4 changes: 2 additions & 2 deletions controller/metrics/analysis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ analysis_template_info{name="http-benchmark-test",namespace=""} 1
analysis_template_info{name="http-benchmark-test",namespace="jesse-test"} 1
# HELP analysis_template_metric_info Information on metrics in analysis templates.
# TYPE analysis_template_metric_info gauge
analysis_template_metric_info{name="http-benchmark-test",namespace="",type="Web"} 1
analysis_template_metric_info{name="http-benchmark-test",namespace="jesse-test",type="Web"} 1
analysis_template_metric_info{metric="webmetric",name="http-benchmark-test",namespace="",type="Web"} 1
analysis_template_metric_info{metric="webmetric",name="http-benchmark-test",namespace="jesse-test",type="Web"} 1
`
registry := prometheus.NewRegistry()
at := newFakeAnalysisTemplate(fakeAnalysisTemplate)
Expand Down
2 changes: 1 addition & 1 deletion controller/metrics/prommetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ var (
MetricAnalysisTemplateMetricInfo = prometheus.NewDesc(
"analysis_template_metric_info",
"Information on metrics in analysis templates.",
append(namespaceNameLabels, "type"),
append(namespaceNameLabels, "type", "metric"),
nil,
)
)
Expand Down

0 comments on commit 3929fb9

Please sign in to comment.