From c94464336bbdc38bec788f0bbe91462a74c02ba0 Mon Sep 17 00:00:00 2001 From: Navid Zolghadr Date: Tue, 23 Jun 2020 13:22:44 -0400 Subject: [PATCH] Fix pipelinerun_taskrun_duration_seconds metric This CL changes reporting taskrun duration as part of pipelinerun metric to use knative metrics Record API to match with the rest of the existing metrics. We have been using opensensus stats Record API for reporting pipelinerun_taskrun_duration_seconds metric as oppose to other metrics that we used knative metrics API to report them. At this point only the metrics that are reported with knative metrics are being correctly plumbed to metrics backend. So as a result pipelinerun_taskrun_duration_seconds was missing on the metrics backend. --- pkg/reconciler/taskrun/metrics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/reconciler/taskrun/metrics.go b/pkg/reconciler/taskrun/metrics.go index 3ce9a0e97f4..3dcc78570bf 100644 --- a/pkg/reconciler/taskrun/metrics.go +++ b/pkg/reconciler/taskrun/metrics.go @@ -204,7 +204,7 @@ func (r *Recorder) DurationAndCount(tr *v1beta1.TaskRun) error { return err } - stats.Record(ctx, prTRDuration.M(float64(duration/time.Second))) + metrics.Record(ctx, prTRDuration.M(float64(duration/time.Second))) metrics.Record(ctx, trCount.M(1)) return nil }