Skip to main content
Tekton Pipelines exposes metrics for monitoring pipeline execution, controller performance, and resource utilization.

Metrics Endpoint

Metrics are available at the tekton-pipelines-controller service on port 9090:
Access metrics at: http://127.0.0.1:9090/metrics

Available Metrics

All metrics are experimental and subject to change.

PipelineRun Metrics

Histogram/Gauge
Duration of PipelineRuns in seconds.Labels:
  • pipeline - Pipeline name (optional)
  • pipelinerun - PipelineRun name (optional)
  • status - Completion status
  • namespace - PipelineRun namespace
  • reason - Completion reason (optional)
Variants: _bucket, _sum, _count
Histogram/Gauge
Duration of TaskRuns within PipelineRuns in seconds.Labels:
  • pipeline - Pipeline name (optional)
  • pipelinerun - PipelineRun name (optional)
  • task - Task name (optional)
  • taskrun - TaskRun name (optional)
  • status - Completion status
  • namespace - Namespace
  • reason - Completion reason (optional)
Variants: _bucket, _sum, _count
Counter
Total number of PipelineRuns.Labels:
  • status - Completion status
Gauge
Number of currently running PipelineRuns.

TaskRun Metrics

Histogram/Gauge
Duration of TaskRuns in seconds.Labels:
  • task - Task name (optional)
  • taskrun - TaskRun name (optional)
  • status - Completion status
  • namespace - TaskRun namespace
  • reason - Completion reason (optional)
Variants: _bucket, _sum, _count
Counter
Total number of TaskRuns.Labels:
  • status - Completion status
Gauge
Number of currently running TaskRuns.

Throttling Metrics

Gauge
Number of TaskRuns throttled by resource quota.Labels:
  • namespace - TaskRun namespace (optional)
Gauge
Number of TaskRuns throttled by node availability.Labels:
  • namespace - TaskRun namespace (optional)

Client Metrics

Histogram
Kubernetes API client latency in milliseconds.Variants: _bucket, _sum, _count

Metrics Configuration

Configure metrics behavior in the config-observability ConfigMap:

TaskRun Metrics Level

string
default:"task"
Granularity level for TaskRun metrics.
  • taskrun - Include taskrun label (highest cardinality)
  • task - Include task label, exclude taskrun label
  • namespace - Include only namespace label (lowest cardinality)

TaskRun Duration Type

string
default:"histogram"
Metric type for TaskRun duration.
  • histogram - Histogram with buckets for duration distribution
  • lastvalue - Gauge with last observed duration
Histogram is not available when taskrun or pipelinerun labels are selected (leads to single bar).

PipelineRun Metrics Level

string
default:"pipeline"
Granularity level for PipelineRun metrics.
  • pipelinerun - Include pipelinerun label (highest cardinality)
  • pipeline - Include pipeline label, exclude pipelinerun label
  • namespace - Include only namespace label (lowest cardinality)

Running PipelineRun Level

string
default:""
Granularity level for running PipelineRun count metrics.
  • pipelinerun - Include pipelinerun label
  • pipeline - Include pipeline label
  • namespace - Include namespace label
  • "" (empty) - Cluster level, no labels

PipelineRun Duration Type

string
default:"histogram"
Metric type for PipelineRun duration.
  • histogram - Histogram with buckets
  • lastvalue - Gauge with last value

Reason Label

boolean
default:"false"
Include reason label on duration metrics.
Does not affect total counters (*_total), which always include reason.

Throttle Namespace Label

boolean
default:"false"
Include namespace label on throttle metrics.

OpenTelemetry Configuration

Metrics Protocol

string
default:"prometheus"
Protocol for metrics export.Options: prometheus, grpc, http/protobuf, none
string
Metrics endpoint for gRPC/HTTP protocols.
duration
Metrics export interval.

Tracing Configuration

string
default:"none"
Protocol for tracing export.Options: grpc, http/protobuf, none, stdout
string
Tracing endpoint for gRPC/HTTP protocols.
string
default:"1.0"
Tracing sampling rate (0.0 to 1.0).

Runtime Profiling

string
default:"disabled"
Enable runtime profiling.Options: enabled, disabled
duration
default:"15s"
Runtime metrics export interval.

Prometheus Integration

ServiceMonitor

For Prometheus Operator, create a ServiceMonitor:

Scrape Configuration

For standard Prometheus, add scrape configuration:

Grafana Dashboards

Example Prometheus queries for Grafana:

PipelineRun Success Rate

Average PipelineRun Duration

Running PipelineRuns by Namespace

TaskRun Throttling

Best Practices

  1. Use namespace-level metrics in production to avoid unbounded cardinality
  2. Enable reason labels only when needed for debugging
  3. Monitor throttling metrics to identify resource quota issues
  4. Set appropriate scrape intervals (30s recommended)
  5. Use histogram type for duration metrics when aggregating across multiple resources
  6. Configure retention policies in your metrics backend
  7. Alert on high failure rates and long-running pipelines
TaskRun and PipelineRun level metrics are not recommended for production as they lead to unbounded cardinality, which can degrade observability database performance.

Verification

Verify metrics configuration is applied: