Metrics Endpoint
Metrics are available at thetekton-pipelines-controller service on port 9090:
Available Metrics
All metrics are experimental and subject to change.PipelineRun Metrics
Duration of PipelineRuns in seconds.Labels:
pipeline- Pipeline name (optional)pipelinerun- PipelineRun name (optional)status- Completion statusnamespace- PipelineRun namespacereason- Completion reason (optional)
_bucket, _sum, _countDuration 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 statusnamespace- Namespacereason- Completion reason (optional)
_bucket, _sum, _countTotal number of PipelineRuns.Labels:
status- Completion status
Number of currently running PipelineRuns.
TaskRun Metrics
Duration of TaskRuns in seconds.Labels:
task- Task name (optional)taskrun- TaskRun name (optional)status- Completion statusnamespace- TaskRun namespacereason- Completion reason (optional)
_bucket, _sum, _countTotal number of TaskRuns.Labels:
status- Completion status
Number of currently running TaskRuns.
Throttling Metrics
Number of TaskRuns throttled by resource quota.Labels:
namespace- TaskRun namespace (optional)
Number of TaskRuns throttled by node availability.Labels:
namespace- TaskRun namespace (optional)
Client Metrics
Kubernetes API client latency in milliseconds.Variants:
_bucket, _sum, _countMetrics Configuration
Configure metrics behavior in theconfig-observability ConfigMap:
TaskRun Metrics Level
Granularity level for TaskRun metrics.
taskrun- Include taskrun label (highest cardinality)task- Include task label, exclude taskrun labelnamespace- Include only namespace label (lowest cardinality)
TaskRun Duration Type
Metric type for TaskRun duration.
histogram- Histogram with buckets for duration distributionlastvalue- Gauge with last observed duration
Histogram is not available when
taskrun or pipelinerun labels are selected (leads to single bar).PipelineRun Metrics Level
Granularity level for PipelineRun metrics.
pipelinerun- Include pipelinerun label (highest cardinality)pipeline- Include pipeline label, exclude pipelinerun labelnamespace- Include only namespace label (lowest cardinality)
Running PipelineRun Level
Granularity level for running PipelineRun count metrics.
pipelinerun- Include pipelinerun labelpipeline- Include pipeline labelnamespace- Include namespace label""(empty) - Cluster level, no labels
PipelineRun Duration Type
Metric type for PipelineRun duration.
histogram- Histogram with bucketslastvalue- Gauge with last value
Reason Label
Include
reason label on duration metrics.Does not affect total counters (
*_total), which always include reason.Throttle Namespace Label
Include
namespace label on throttle metrics.OpenTelemetry Configuration
Metrics Protocol
Protocol for metrics export.Options:
prometheus, grpc, http/protobuf, noneMetrics endpoint for gRPC/HTTP protocols.
Metrics export interval.
Tracing Configuration
Protocol for tracing export.Options:
grpc, http/protobuf, none, stdoutTracing endpoint for gRPC/HTTP protocols.
Tracing sampling rate (0.0 to 1.0).
Runtime Profiling
Enable runtime profiling.Options:
enabled, disabledRuntime 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
- Use namespace-level metrics in production to avoid unbounded cardinality
- Enable reason labels only when needed for debugging
- Monitor throttling metrics to identify resource quota issues
- Set appropriate scrape intervals (30s recommended)
- Use histogram type for duration metrics when aggregating across multiple resources
- Configure retention policies in your metrics backend
- Alert on high failure rates and long-running pipelines