-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Feature Request: Expose Pipeline and Namespace-Level Metrics in Tekton Pipelines
Problem statement
Tekton Pipelines currently exposes only controller-level metrics through the controller-service (port 9090). These metrics:
- Are global, not tied to any specific PipelineRun, TaskRun, Pipeline, or namespace.
- Do not include labels such as
pipeline,task,pipelineRun, ornamespace. - Cannot be used to build per-tenant or per-pipeline dashboards, alerts, or SLA indicators.
As a result, users operating multi‑tenant clusters or large-scale CI/CD platforms cannot:
- Measure performance per pipeline.
- Monitor reliability per namespace.
- Produce accurate per-tenant observability.
- Track execution durations, success/failure rates, or trends per pipeline.
Why this feature is needed
1. Tekton only exposes controller metrics today
The official documentation shows that only controller-level Prometheus metrics are available and they are not pipeline-aware nor namespace-aware.
2. Modern production systems require per-pipeline and per-namespace metrics
Examples:
- Error rates per pipeline
- Duration per pipeline or task
- Tenant‑level SLAs (by namespace)
- Cost allocation per CI pipeline
- Alerts tied to specific pipelines
3. Large multi‑tenant clusters cannot rely on global aggregation
Without pipeline/ns labels, metrics are impossible to group meaningfully.
4. Tekton Results is not a metrics system
While Tekton Results allows storing and querying PipelineRuns, it does not expose Prometheus metrics, meaning a custom pipeline metrics layer is still needed.
5. The CNCF ecosystem expects detailed metrics
Prometheus, Grafana, Argo, and Kubernetes controllers typically expose granular metrics with labels.
Proposed feature
Expose metrics for the following entities:
- PipelineRuns
- Pipelines
- TaskRuns
- Tasks
- Namespaces
With labels such as:
namespace="team-a"
pipeline="build-app"
pipelineRun="build-app-9x2kz"
task="compile"
status="success|failed|running"
Proposed metrics include:
Pipeline-level
tekton_pipeline_run_duration_seconds{namespace="team-a", pipeline="build"} 12.4
tekton_pipeline_run_count{namespace="team-a", pipeline="deploy", status="success"} 42
tekton_pipeline_run_count{namespace="team-a", pipeline="deploy", status="failed"} 3
Task-level
tekton_task_run_duration_seconds{namespace="team-a", pipeline="build", task="compile"} 4.8
Namespace-level
tekton_pipelinerun_total{namespace="team-a"} 1034
tekton_taskrun_total{namespace="team-a"} 5821
Implementation ideas:
- Add new metrics directly in the Tekton controller.
- Introduce a lightweight Tekton Metrics sidecar.
- Add pluggable metric collectors.
- Use Tekton Results as a backend for metrics aggregation.
Summary
Adding pipeline-level and namespace-level metrics to Tekton Pipelines would:
- Dramatically improve observability.
- Enable multi‑tenant and enterprise use cases.
- Reduce operational overhead for large-scale users.
- Bring Tekton in line with other CNCF project observability models.