Skip to content

Tekton Pruner Metrics

This document describes the metrics exposed by the Tekton Pruner controller using OpenTelemetry. Metrics are available on port 9090 at /metrics.

The names below are the Prometheus metric names as they appear in the /metrics endpoint. The OTel SDK automatically appends _total to counters and _seconds to histograms with unit s.

Available Metrics

Counters

MetricDescriptionLabels
tekton_pruner_controller_resources_processed_totalTotal unique resources processednamespace, resource_type, status
tekton_pruner_controller_reconciliation_events_totalTotal reconciliation eventsnamespace, resource_type, status
tekton_pruner_controller_resources_deleted_totalTotal resources deletednamespace, resource_type, operation
tekton_pruner_controller_resources_errors_totalTotal processing errorsnamespace, resource_type, error_type, reason

Histograms

MetricDescriptionLabels
tekton_pruner_controller_reconciliation_duration_secondsReconciliation timenamespace, resource_type
tekton_pruner_controller_ttl_processing_duration_secondsTTL processing timenamespace, resource_type, operation
tekton_pruner_controller_history_processing_duration_secondsHistory processing timenamespace, resource_type, operation
tekton_pruner_controller_resource_age_at_deletion_secondsResource age when deletednamespace, resource_type, operation

Note: All metrics carry an otel_scope_name label (tekton_pruner_controller). This is informational and transparent to most PromQL queries.

Label Values

  • resource_type: pipelinerun, taskrun
  • operation: ttl, history
  • status: success, failed, error
  • error_type: api_error, timeout, validation, internal, not_found, permission

Useful Queries

Processing Rate

# Resources processed per second
rate(tekton_pruner_controller_resources_processed_total[5m])

# Deletion rate by operation
sum(rate(tekton_pruner_controller_resources_deleted_total[5m])) by (operation)

Performance

# 95th percentile reconciliation time
histogram_quantile(0.95, rate(tekton_pruner_controller_reconciliation_duration_seconds_bucket[5m]))

# Slow reconciliations (>5s)
histogram_quantile(0.95, rate(tekton_pruner_controller_reconciliation_duration_seconds_bucket[5m])) > 5

Errors

# Error rate
rate(tekton_pruner_controller_resources_errors_total[5m])

# Error ratio
rate(tekton_pruner_controller_resources_errors_total[5m]) / rate(tekton_pruner_controller_resources_processed_total[5m])

Resource State

# Current active resources
tekton_pruner_controller_active_resources

# Resources pending deletion  
tekton_pruner_controller_pending_deletions

Basic Alerts

- alert: TektonPrunerHighErrorRate
  expr: rate(tekton_pruner_controller_resources_errors_total[5m]) / rate(tekton_pruner_controller_resources_processed_total[5m]) > 0.1
  for: 5m

- alert: TektonPrunerStalled
  expr: rate(tekton_pruner_controller_resources_processed_total[10m]) == 0 and tekton_pruner_controller_active_resources > 0
  for: 10m

Configuration

Metrics are configured via the config-observability-tekton-pruner ConfigMap in the tekton-pipelines namespace. By default, Prometheus export is enabled on port 9090.

See config-observability.yaml for the full list of configuration options.

KeyValuesDefault
metrics-protocolprometheus, grpc, http/protobuf, noneprometheus
metrics-endpointOTLP endpoint (for grpc/http)empty
tracing-protocolnone, grpc, http/protobuf, stdoutnone
tracing-endpointOTLP tracing endpointempty