Pipeline Monitoring with Prometheus and Grafana
This documentation describes how to integrate tekton-pipelines metrics with Prometheus and Grafana monitoring stack.
Prerequisites​
Ensure the following requirements are met first before moving ahead:
- Kube prometheus stack is installed;
- Tekton pipeline is installed.
Create and Apply the Additional Scrape Config​
To create and apply the additional scrape config, follow the steps below:
-
Create the kubernetes secret file with the additional scrape config:
apiVersion: v1
kind: Secret
metadata:
name: additional-scrape-configs
stringData:
prometheus-additional-job.yaml: |
- job_name: "tekton-pipelines"
scrape_interval: 30s
static_configs:
- targets: ["tekton-pipelines-controller.tekton-pipelines.svc.cluster.local:9090"] -
Apply the created secret:
kubectl apply -f additional-scrape-configs.yaml -n <monitoring-namespace>
-
Update the prometheus stack:
helm update --install prometheus prometheus-community/kube-prometheus-stack --values values.yaml -n <monitoring-namespace>
The
values.yaml
file should have the following contents:values.yamlprometheus:
prometheusSpec:
additionalScrapeConfigsSecret:
enabled: true
name: additional-scrape-configs
key: prometheus-additional-job.yaml -
Download the KubeRocketCi dashboard:
a. Click on the dashboard menu;
b. In the dropdown menu, click the
+ Import
button;c. Select the created
18321_rev*.json
file;d. Type the name of the dashboard;
e. Select the folder for the dashboard;
f. Type the UID (set of eight numbers or letters and symbols);
g. Click the
Import
button.
As soon as the dashboard procedure is completed, you can track the newcoming metrics in the dashboard menu: