You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: prometheus-install/README.md
+15-9Lines changed: 15 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,17 @@ After deploying Flink cluster, you can then deploy Prometheus to monitor the met
6
6
7
7
**Linux:**
8
8
```
9
+
sed -i s/OPERATOR/$(kubectl get pods -lapp.kubernetes.io/name=flink-kubernetes-operator -n flink -o=jsonpath="{range .items[*]}{.status.podIP}{','}{end}" | cut -d ',' -f1)/g prometheus-install/prometheus-config.yaml
9
10
sed -i s/JOB_MANAGER/$(kubectl get pods -lapp=recommendation-app -n flink -o=jsonpath="{range .items[*]}{.status.podIP}{','}{end}" | cut -d ',' -f1)/g prometheus-install/prometheus-config.yaml
10
11
sed -i s/TASK_MANAGER/$(kubectl get pods -lapp=recommendation-app -n flink -o=jsonpath="{range .items[*]}{.status.podIP}{','}{end}" | cut -d ',' -f2)/g prometheus-install/prometheus-config.yaml
11
12
```
12
13
**MacOS**
13
14
```
15
+
sed -i '' s/JOB_MANAGER/$(kubectl get pods -lapp.kubernetes.io/name=flink-kubernetes-operator -n flink -o=jsonpath="{range .items[*]}{.status.podIP}{','}{end}" | cut -d ',' -f1)/g prometheus-install/prometheus-config.yaml
14
16
sed -i '' s/JOB_MANAGER/$(kubectl get pods -lapp=recommendation-app -n flink -o=jsonpath="{range .items[*]}{.status.podIP}{','}{end}" | cut -d ',' -f1)/g prometheus-install/prometheus-config.yaml
15
17
sed -i '' s/TASK_MANAGER/$(kubectl get pods -lapp=recommendation-app -n flink -o=jsonpath="{range .items[*]}{.status.podIP}{','}{end}" | cut -d ',' -f2)/g prometheus-install/prometheus-config.yaml
16
18
```
17
-
Note: Here we assume there's only 1 job manager and 1 task manager. If you deployed more than that, please update the `prometheus-config.yaml` file.
19
+
Note: Here we assume there's only 1 flink kubernetes operator, 1 job manager, and 1 task manager. If you deployed more than that, please update the `prometheus-config.yaml` file.
18
20
19
21
2. Install prometheus, configuration, and service:
20
22
```
@@ -25,22 +27,26 @@ After deploying Flink cluster, you can then deploy Prometheus to monitor the met
4. Now you can monitor the metrics in job manager or task manager via the Prometheus UI is accessible at localhost:9090.
29
-

30
-

30
+
4. Now you can monitor the metrics in flink kubernetes operator, job manager or task manager via the Prometheus UI is accessible at localhost:9090.
31
+

32
+

33
+

31
34
32
35
# Integrate Prometheus into Flink cluster deployed on OpenShift
33
36
34
37
Since Openshift already has a built-in Prometheus installed and configured, we can integrate with it by deploying a `PodMonitor` CR for the flink cluster:
35
38
36
-
1. Install the pre-configured `PodMonitor` CR:
39
+
1. Install the pre-configured `PodMonitor`, `service`, and `serviceMonitor` CRs:
Note: This CR is configured to select the `FlinkDeployment` created as part of the `recommendation-app` example. Please update the `selector.matchLabels` field in `flink-monitor.yaml` if you are running a different example.
43
+
Note: These CRs are configured to select the Flink kubernetes operator, and
44
+
`FlinkDeployment` created as part of the `recommendation-app` example.
45
+
Please update the `selector.matchLabels` field in `flink-monitor.yaml` if you are running a different example.
41
46
42
47
2. It takes around 5 minutes to wait for prometheus operator to update the config for prometheus server. After that, you can query the metrics in the OpenShift UI as described [here](https://docs.openshift.com/container-platform/4.16/observability/monitoring/managing-metrics.html#querying-metrics-for-all-projects-as-an-administrator_managing-metrics).
0 commit comments