Skip to content

Commit 24bac5d

Browse files
authored
Merge pull request #46295 from sounix000/4124-triggers-metrics
RHDEVDOCS-4124 Operator displays Trigger metrics in devconsole
2 parents 9f1056a + 79282cd commit 24bac5d

File tree

2 files changed

+65
-2
lines changed

2 files changed

+65
-2
lines changed

cicd/pipelines/creating-applications-with-cicd-pipelines.adoc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
:_content-type: ASSEMBLY
2-
[id='creating-applications-with-cicd-pipelines']
2+
[id="creating-applications-with-cicd-pipelines"]
33
= Creating CI/CD solutions for applications using OpenShift Pipelines
44
include::_attributes/common-attributes.adoc[]
55
:context: creating-applications-with-cicd-pipelines
@@ -63,13 +63,20 @@ include::modules/op-creating-webhooks.adoc[leveloffset=+1]
6363

6464
include::modules/op-triggering-a-pipelinerun.adoc[leveloffset=+1]
6565

66+
include::modules/op-enabling-monitoring-of-event-listeners-for-triggers-for-user-defined-projects.adoc[leveloffset=+1]
67+
68+
[role="_additional-resources"]
69+
.Additional resources
70+
71+
* xref:../../monitoring/enabling-monitoring-for-user-defined-projects.adoc#enabling-monitoring-for-user-defined-projects[Enabling monitoring for user-defined projects]
72+
6673
[role="_additional-resources"]
6774
[id="pipeline-addtl-resources"]
6875
== Additional resources
6976

7077
* For more details on pipelines in the *Developer* perspective, see the xref:../../cicd/pipelines/working-with-pipelines-using-the-developer-perspective.adoc#working-with-pipelines-using-the-developer-perspective[working with pipelines in the *Developer* perspective] section.
7178
* To learn more about Security Context Constraints (SCCs), see the xref:../../authentication/managing-security-context-constraints.adoc#managing-pod-security-policies[Managing Security Context Constraints] section.
7279
* For more examples of reusable tasks, see the link:https://github.com/openshift/pipelines-catalog[OpenShift Catalog] repository. Additionally, you can also see the Tekton Catalog in the Tekton project.
73-
* To install and deploy a custom instance of Tekton Hub for resuable tasks and pipelines, see xref:../../cicd/pipelines/using-tekton-hub-with-openshift-pipelines.adoc#using-tekton-hub-with-openshift-pipelines[Using {tekton-hub} with {pipelines-title}].
80+
* To install and deploy a custom instance of Tekton Hub for reusable tasks and pipelines, see xref:../../cicd/pipelines/using-tekton-hub-with-openshift-pipelines.adoc#using-tekton-hub-with-openshift-pipelines[Using {tekton-hub} with {pipelines-title}].
7481
* For more details on re-encrypt TLS termination, see link:https://docs.openshift.com/container-platform/3.11/architecture/networking/routes.html#re-encryption-termination[Re-encryption Termination].
7582
* For more details on secured routes, see the xref:../../networking/routes/secured-routes.adoc#secured-routes[Secured routes] section.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// This module is included in the following assembly:
2+
//
3+
// *cicd/pipelines/creating-applications-with-cicd-pipelines.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="enabling-monitoring-of-event-listeners-for-triggers-for-user-defined-projects_{context}"]
7+
= Enabling monitoring of event listeners for Triggers for user-defined projects
8+
9+
As a cluster administrator, to gather event listener metrics for the `Triggers` service in a user-defined project and display them in the {product-title} web console, you can create a service monitor for each event listener. On receiving a HTTP request, event listeners for the `Triggers` service return three metrics -- `eventlistener_http_duration_seconds`, `eventlistener_event_count`, and `eventlistener_triggered_resources`.
10+
11+
.Prerequisites
12+
13+
* You have logged in to the {product-title} web console.
14+
* You have installed the {pipelines-title} Operator.
15+
* You have enabled monitoring for user-defined projects.
16+
17+
.Procedure
18+
19+
. For each event listener, create a service monitor. For example, to view the metrics for the `github-listener` event listener in the `test` namespace, create the following service monitor:
20+
+
21+
[source,yaml]
22+
----
23+
apiVersion: monitoring.coreos.com/v1
24+
kind: ServiceMonitor
25+
metadata:
26+
labels:
27+
app.kubernetes.io/managed-by: EventListener
28+
app.kubernetes.io/part-of: Triggers
29+
eventlistener: github-listener
30+
annotations:
31+
networkoperator.openshift.io/ignore-errors: ""
32+
name: el-monitor
33+
namespace: test
34+
spec:
35+
endpoints:
36+
- interval: 10s
37+
port: http-metrics
38+
jobLabel: name
39+
namespaceSelector:
40+
matchNames:
41+
- test
42+
selector:
43+
matchLabels:
44+
app.kubernetes.io/managed-by: EventListener
45+
app.kubernetes.io/part-of: Triggers
46+
eventlistener: github-listener
47+
...
48+
----
49+
. Test the service monitor by sending a request to the event listener. For example, push an empty commit:
50+
+
51+
[source,terminal]
52+
----
53+
$ git commit -m "empty-commit" --allow-empty && git push origin main
54+
----
55+
. On the {product-title} web console, navigate to **Administrator** -> **Observe** -> **Metrics**.
56+
. To view a metric, search by its name. For example, to view the details of the `eventlistener_http_resources` metric for the `github-listener` event listener, search using the `eventlistener_http_resources` keyword.

0 commit comments

Comments
 (0)