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
= Querying metrics by using the federation endpoint for Prometheus
8
8
9
-
You can use the federation endpoint to scrape platform and user-defined metrics from a network location outside the cluster.
9
+
You can use the federation endpoint for Prometheus to scrape platform and user-defined metrics from a network location outside the cluster.
10
10
To do so, access the Prometheus `/federate` endpoint for the cluster via an {product-title} route.
11
11
12
12
[IMPORTANT]
@@ -17,11 +17,11 @@ This delay can affect the accuracy and timeliness of the scraped metrics.
17
17
Using the federation endpoint can also degrade the performance and scalability of your cluster, especially if you use the federation endpoint to retrieve large amounts of metrics data.
18
18
To avoid these issues, follow these recommendations:
19
19
20
-
* Do not try to retrieve all metrics data via the federation endpoint.
20
+
* Do not try to retrieve all metrics data via the federation endpoint for Prometheus.
21
21
Query it only when you want to retrieve a limited, aggregated data set.
22
22
For example, retrieving fewer than 1,000 samples for each request helps minimize the risk of performance degradation.
23
23
24
-
* Avoid querying the federation endpoint frequently.
24
+
* Avoid frequent querying of the federation endpoint for Prometheus.
25
25
Limit queries to a maximum of one every 30 seconds.
26
26
27
27
If you need to forward large amounts of data outside the cluster, use remote write instead. For more information, see the _Configuring remote write storage_ section.
@@ -30,34 +30,43 @@ If you need to forward large amounts of data outside the cluster, use remote wri
30
30
.Prerequisites
31
31
32
32
* You have installed the OpenShift CLI (`oc`).
33
-
* You have obtained the host URL for the {product-title} route.
34
33
* You have access to the cluster as a user with the `cluster-monitoring-view` cluster role or have obtained a bearer token with `get` permission on the `namespaces` resource.
35
34
+
36
35
[NOTE]
37
36
====
38
-
You can only use bearer token authentication to access the federation endpoint.
37
+
You can only use bearer token authentication to access the Prometheus federation endpoint.
38
+
====
39
+
40
+
* You are logged in to an account that has permission to get the Prometheus federation route.
41
+
+
42
+
[NOTE]
43
+
====
44
+
If your account does not have permission to get the Prometheus federation route, a cluster administrator can provide the URL for the route.
39
45
====
40
46
41
47
.Procedure
42
48
43
-
. Retrieve the bearer token:
49
+
. Retrieve the bearer token by running the following the command:
44
50
+
45
51
[source,terminal]
46
52
----
47
-
$ TOKEN=`oc whoami -t`
53
+
$ TOKEN=$(oc whoami -t)
48
54
----
49
55
50
-
. Query metrics from the `/federate` route.
51
-
The following example queries `up` metrics:
56
+
. Get the Prometheus federation route URL by running the following command:
0 commit comments