Skip to content

Commit 8c61e5e

Browse files
authored
Merge pull request #54596 from bburt-rh/RHDEVDOCS-3456-how-to-view-default-monitoring-metrics
RHDEVDOCS-3456-how-to-view-default-monitoring-metrics
2 parents 4312d29 + c2896e5 commit 8c61e5e

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * monitoring/managing-metrics.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="viewing-a-list-of-available-metrics_{context}"]
7+
= Viewing a list of available metrics
8+
9+
As a cluster administrator or as a user with view permissions for all projects, you can view a list of metrics available in a cluster and output the list in JSON format.
10+
11+
.Prerequisites
12+
* You have installed the {product-title} CLI (`oc`).
13+
* You have obtained the {product-title} API route for Thanos Querier.
14+
* You are a cluster administrator, or you have access to the cluster as a user with the `cluster-monitoring-view` role.
15+
+
16+
[NOTE]
17+
====
18+
You can only use bearer token authentication to access the Thanos Querier API route.
19+
====
20+
21+
.Procedure
22+
23+
. If you have not obtained the {product-title} API route for Thanos Querier, run the following command:
24+
+
25+
[source,terminal]
26+
----
27+
$ oc get routes -n openshift-monitoring thanos-querier -o jsonpath='{.status.ingress[0].host}'
28+
----
29+
30+
. Retrieve a list of metrics in JSON format from the Thanos Querier API route by running the following command. This command uses `oc` to authenticate with a bearer token.
31+
+
32+
[source,terminal]
33+
----
34+
$ curl -k -H "Authorization: Bearer $(oc whoami -t)" https://<thanos_querier_route>/api/v1/metadata <1>
35+
----
36+
<1> Replace `<thanos_querier_route>` with the {product-title} API route for Thanos Querier.

monitoring/managing-metrics.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ include::modules/monitoring-specifying-how-a-service-is-monitored.adoc[leveloffs
3030
* xref:../rest_api/monitoring_apis/podmonitor-monitoring-coreos-com-v1.adoc[PodMonitor API]
3131
* xref:../rest_api/monitoring_apis/servicemonitor-monitoring-coreos-com-v1.adoc[ServiceMonitor API]
3232
33+
// Viewing a list of available metrics for a cluster
34+
include::modules/monitoring-viewing-a-list-of-available-metrics.adoc[leveloffset=+1]
35+
3336
[id="next-steps_querying-metrics"]
3437
== Next steps
3538

0 commit comments

Comments
 (0)