Skip to content

Commit

Permalink
fixed broke metrics endpoint per argoproj#1634
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardAvendano committed Oct 19, 2019
1 parent dd517e4 commit f992577
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions workflow/metrics/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (wc *workflowCollector) Collect(ch chan<- prometheus.Metric) {

func (wc *workflowCollector) collectWorkflow(ch chan<- prometheus.Metric, wf wfv1.Workflow) {
addConstMetric := func(desc *prometheus.Desc, t prometheus.ValueType, v float64, lv ...string) {
lv = append([]string{wf.Namespace, wf.Name}, lv...)
lv = append([]string{wf.Namespace, wf.Name, wf.Spec.Entrypoint}, lv...)
ch <- prometheus.MustNewConstMetric(desc, t, v, lv...)
}
addGauge := func(desc *prometheus.Desc, v float64, lv ...string) {
Expand All @@ -110,7 +110,7 @@ func (wc *workflowCollector) collectWorkflow(ch chan<- prometheus.Metric, wf wfv
return strings.Join(templates, ",")
}

addGauge(descWorkflowInfo, 1, wf.Spec.Entrypoint, wf.Spec.ServiceAccountName, joinTemplates(wf.Spec.Templates))
addGauge(descWorkflowInfo, 1, wf.Spec.ServiceAccountName, joinTemplates(wf.Spec.Templates))

addGauge(descWorkflowStatusPhase, boolFloat64(wf.Status.Phase == wfv1.NodePending || wf.Status.Phase == ""), string(wfv1.NodePending))
addGauge(descWorkflowStatusPhase, boolFloat64(wf.Status.Phase == wfv1.NodeRunning), string(wfv1.NodeRunning))
Expand Down

0 comments on commit f992577

Please sign in to comment.