5757
5858 trDurationView * view.View
5959 prTRDurationView * view.View
60- trCountView * view.View
6160 trTotalView * view.View
62- runningTRsCountView * view.View
6361 runningTRsView * view.View
64- runningTRsThrottledByQuotaCountView * view.View
65- runningTRsThrottledByNodeCountView * view.View
6662 runningTRsThrottledByQuotaView * view.View
6763 runningTRsThrottledByNodeView * view.View
6864 runningTRsWaitingOnTaskResolutionCountView * view.View
@@ -78,30 +74,14 @@ var (
7874 "The pipelinerun's taskrun execution time in seconds" ,
7975 stats .UnitDimensionless )
8076
81- trCount = stats .Float64 ("taskrun_count" ,
82- "number of taskruns" ,
83- stats .UnitDimensionless )
84-
8577 trTotal = stats .Float64 ("taskrun_total" ,
8678 "Number of taskruns" ,
8779 stats .UnitDimensionless )
8880
89- runningTRsCount = stats .Float64 ("running_taskruns_count" ,
90- "Number of taskruns executing currently" ,
91- stats .UnitDimensionless )
92-
9381 runningTRs = stats .Float64 ("running_taskruns" ,
9482 "Number of taskruns executing currently" ,
9583 stats .UnitDimensionless )
9684
97- runningTRsThrottledByQuotaCount = stats .Float64 ("running_taskruns_throttled_by_quota_count" ,
98- "Number of taskruns executing currently, but whose underlying Pods or Containers are suspended by k8s because of defined ResourceQuotas. Such suspensions can occur as part of initial scheduling of the Pod, or scheduling of any of the subsequent Container(s) in the Pod after the first Container is started" ,
99- stats .UnitDimensionless )
100-
101- runningTRsThrottledByNodeCount = stats .Float64 ("running_taskruns_throttled_by_node_count" ,
102- "Number of taskruns executing currently, but whose underlying Pods or Containers are suspended by k8s because of Node level constraints. Such suspensions can occur as part of initial scheduling of the Pod, or scheduling of any of the subsequent Container(s) in the Pod after the first Container is started" ,
103- stats .UnitDimensionless )
104-
10585 runningTRsWaitingOnTaskResolutionCount = stats .Float64 ("running_taskruns_waiting_on_task_resolution_count" ,
10686 "Number of taskruns executing currently that are waiting on resolution requests for their task references." ,
10787 stats .UnitDimensionless )
@@ -217,9 +197,7 @@ func viewRegister(cfg *config.Metrics) error {
217197 }
218198 }
219199
220- trCountViewTags := []tag.Key {statusTag }
221200 if cfg .CountWithReason {
222- trCountViewTags = append (trCountViewTags , reasonTag )
223201 trunTag = append (trunTag , reasonTag )
224202 }
225203
@@ -236,39 +214,18 @@ func viewRegister(cfg *config.Metrics) error {
236214 TagKeys : append ([]tag.Key {statusTag , namespaceTag }, append (trunTag , prunTag ... )... ),
237215 }
238216
239- trCountView = & view.View {
240- Description : trCount .Description (),
241- Measure : trCount ,
242- Aggregation : view .Count (),
243- TagKeys : trCountViewTags ,
244- }
245217 trTotalView = & view.View {
246218 Description : trTotal .Description (),
247219 Measure : trTotal ,
248220 Aggregation : view .Count (),
249221 TagKeys : []tag.Key {statusTag },
250222 }
251- runningTRsCountView = & view.View {
252- Description : runningTRsCount .Description (),
253- Measure : runningTRsCount ,
254- Aggregation : view .LastValue (),
255- }
256223
257224 runningTRsView = & view.View {
258225 Description : runningTRs .Description (),
259226 Measure : runningTRs ,
260227 Aggregation : view .LastValue (),
261228 }
262- runningTRsThrottledByQuotaCountView = & view.View {
263- Description : runningTRsThrottledByQuotaCount .Description (),
264- Measure : runningTRsThrottledByQuotaCount ,
265- Aggregation : view .LastValue (),
266- }
267- runningTRsThrottledByNodeCountView = & view.View {
268- Description : runningTRsThrottledByNodeCount .Description (),
269- Measure : runningTRsThrottledByNodeCount ,
270- Aggregation : view .LastValue (),
271- }
272229 runningTRsWaitingOnTaskResolutionCountView = & view.View {
273230 Description : runningTRsWaitingOnTaskResolutionCount .Description (),
274231 Measure : runningTRsWaitingOnTaskResolutionCount ,
@@ -300,12 +257,8 @@ func viewRegister(cfg *config.Metrics) error {
300257 return view .Register (
301258 trDurationView ,
302259 prTRDurationView ,
303- trCountView ,
304260 trTotalView ,
305- runningTRsCountView ,
306261 runningTRsView ,
307- runningTRsThrottledByQuotaCountView ,
308- runningTRsThrottledByNodeCountView ,
309262 runningTRsWaitingOnTaskResolutionCountView ,
310263 runningTRsThrottledByQuotaView ,
311264 runningTRsThrottledByNodeView ,
@@ -317,12 +270,8 @@ func viewUnregister() {
317270 view .Unregister (
318271 trDurationView ,
319272 prTRDurationView ,
320- trCountView ,
321273 trTotalView ,
322- runningTRsCountView ,
323274 runningTRsView ,
324- runningTRsThrottledByQuotaCountView ,
325- runningTRsThrottledByNodeCountView ,
326275 runningTRsWaitingOnTaskResolutionCountView ,
327276 runningTRsThrottledByQuotaView ,
328277 runningTRsThrottledByNodeView ,
@@ -467,7 +416,6 @@ func (r *Recorder) DurationAndCount(ctx context.Context, tr *v1.TaskRun, beforeC
467416 }
468417
469418 metrics .Record (ctx , durationStat .M (duration .Seconds ()))
470- metrics .Record (ctx , trCount .M (1 ))
471419 metrics .Record (ctx , trTotal .M (1 ))
472420
473421 return nil
@@ -492,9 +440,7 @@ func (r *Recorder) RunningTaskRuns(ctx context.Context, lister listers.TaskRunLi
492440
493441 var runningTrs int
494442 trsThrottledByQuota := map [string ]int {}
495- trsThrottledByQuotaCount := 0
496443 trsThrottledByNode := map [string ]int {}
497- trsThrottledByNodeCount := 0
498444 var trsWaitResolvingTaskRef int
499445 for _ , pr := range trs {
500446 // initialize metrics with namespace tag to zero if unset; will then update as needed below
@@ -516,12 +462,10 @@ func (r *Recorder) RunningTaskRuns(ctx context.Context, lister listers.TaskRunLi
516462 if succeedCondition != nil && succeedCondition .Status == corev1 .ConditionUnknown {
517463 switch succeedCondition .Reason {
518464 case pod .ReasonExceededResourceQuota :
519- trsThrottledByQuotaCount ++
520465 cnt := trsThrottledByQuota [pr .Namespace ]
521466 cnt ++
522467 trsThrottledByQuota [pr .Namespace ] = cnt
523468 case pod .ReasonExceededNodeResources :
524- trsThrottledByNodeCount ++
525469 cnt := trsThrottledByNode [pr .Namespace ]
526470 cnt ++
527471 trsThrottledByNode [pr .Namespace ] = cnt
@@ -535,11 +479,8 @@ func (r *Recorder) RunningTaskRuns(ctx context.Context, lister listers.TaskRunLi
535479 if err != nil {
536480 return err
537481 }
538- metrics .Record (ctx , runningTRsCount .M (float64 (runningTrs )))
539482 metrics .Record (ctx , runningTRs .M (float64 (runningTrs )))
540483 metrics .Record (ctx , runningTRsWaitingOnTaskResolutionCount .M (float64 (trsWaitResolvingTaskRef )))
541- metrics .Record (ctx , runningTRsThrottledByQuotaCount .M (float64 (trsThrottledByQuotaCount )))
542- metrics .Record (ctx , runningTRsThrottledByNodeCount .M (float64 (trsThrottledByNodeCount )))
543484
544485 for ns , cnt := range trsThrottledByQuota {
545486 var mutators []tag.Mutator
0 commit comments