Skip to content
On this page

Metrics

This page describes the Prometheus metrics that Pipelines-as-Code exposes and how to query them. Use these metrics to monitor PipelineRun activity, track Git provider API usage, and observe running workloads.

Pipelines-as-Code serves its metrics through the pipelines-as-code-watcher service on port 9090.

Pipelines-as-Code supports various exporters, such as Prometheus, Google Stackdriver, and more. You can configure these exporters by referring to the observability configuration.

Available Metrics

NameTypeLabels/TagsDescription
pipelines_as_code_git_provider_api_request_countCounterprovider=<git_provider>
event-type=<event_type>
namespace=<pipelinerun_namespace>
repository=<repository_cr_name>
Number of API requests submitted to git providers
pipelines_as_code_pipelinerun_countCounterprovider=<git_provider>
event-type=<event_type>
namespace=<pipelinerun_namespace>
repository=<repository_cr_name>
Number of PipelineRuns created by Pipelines-as-Code
pipelines_as_code_pipelinerun_duration_seconds_sumCounternamespace=<pipelinerun_namespace>
repository=<repository_cr_name>
status=<pipelinerun_status>
reason=<pipelinerun_status_reason>
Number of seconds all PipelineRuns have taken in Pipelines-as-Code
pipelines_as_code_running_pipelineruns_countGaugenamespace=<pipelinerun_namespace>
repository=<repository_cr_name>
Number of running PipelineRuns in Pipelines-as-Code

The metric pipelines_as_code_git_provider_api_request_count is emitted by both the Controller and the Watcher, since both services use Git providers’ APIs. When analyzing this metric, you may need to combine both services’ metrics. For example, using PromQL:

  • sum (pac_controller_pipelines_as_code_git_provider_api_request_count or pac_watcher_pipelines_as_code_git_provider_api_request_count)
  • sum (rate(pac_controller_pipelines_as_code_git_provider_api_request_count[1m]) or rate(pac_watcher_pipelines_as_code_git_provider_api_request_count[1m]))

Prometheus query for git provider API usage metrics combined from both the Watcher and the Controller