Skip to content

Commit 281f932

Browse files
authored
Merge pull request #33130 from sbeskin-redhat/1962488_Prometheus_metrics_to_must-gather_section
BZ1962488: Viewing metrics with Prometheus added to 'Collecting logs and metrics with the must-gather tool' section of Troubleshooting
2 parents 1926e59 + 98fb16e commit 281f932

File tree

1 file changed

+48
-8
lines changed

1 file changed

+48
-8
lines changed

modules/migration-using-must-gather.adoc

Lines changed: 48 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,68 @@
44
// * migration-toolkit-for-containers/troubleshooting-mtc
55

66
[id="migration-using-must-gather_{context}"]
7-
= Using must-gather to collect data
87

9-
You must run the `must-gather` tool if you open a customer support case on the link:https://access.redhat.com[Red Hat Customer Portal] for the {mtc-full} ({mtc-short}).
108

11-
The `openshift-migration-must-gather-rhel8` image for {mtc-short} collects migration-specific logs and data that are not collected by the default `must-gather` image.
9+
10+
= Using the must-gather tool
11+
12+
You can collect logs, metrics, and information about {MTC-short} custom resources by using the `must-gather` tool.
13+
14+
The `must-gather` data must be attached to all customer cases.
15+
16+
You can collect data for a one-hour or a 24-hour period and view the data with the Prometheus console.
17+
18+
.Prerequisites
19+
20+
* You must be logged in to the {product-title} cluster as a user with the `cluster-admin` role.
21+
* You must have the OpenShift CLI installed.
1222

1323
.Procedure
1424

1525
. Navigate to the directory where you want to store the `must-gather` data.
16-
. Run the `must-gather` command:
26+
. Run the `oc adm must-gather` command:
27+
28+
* To gather data for the past hour:
1729
+
1830
[source,terminal,subs="attributes+"]
1931
----
2032
$ oc adm must-gather --image=registry.redhat.io/rhmtc/openshift-migration-must-gather-rhel8:v{mtc-version}
2133
----
34+
+
35+
The data is saved as `/must-gather/must-gather.tar.gz`. You can upload this file to a support case on the link:https://access.redhat.com/[Red Hat Customer Portal].
36+
37+
* To gather data for the past 24 hours:
38+
+
39+
[source,terminal,subs="attributes+"]
40+
----
41+
$ oc adm must-gather --image= \
42+
registry.redhat.io/rhmtc/openshift-migration-must-gather-rhel8: \
43+
v{mtc-version} -- /usr/bin/gather_metrics_dump
44+
----
45+
+
46+
This operation can take a long time. The data is saved as `/must-gather/metrics/prom_data.tar.gz`. You can view this file with the Prometheus console.
47+
48+
.To view data with the Prometheus console
2249

23-
. Remove authentication keys and other sensitive information.
24-
. Create an archive file containing the contents of the `must-gather` data directory:
50+
. Create a local Prometheus instance:
51+
+
52+
[source,terminal]
53+
----
54+
$ make prometheus-run
55+
----
56+
+
57+
The command outputs the Prometheus URL:
2558
+
59+
.Output
2660
[source,terminal]
2761
----
28-
$ tar cvaf must-gather.tar.gz must-gather.local.<uid>/
62+
Started Prometheus on http://localhost:9090
2963
----
3064

31-
. Upload the compressed file as an attachment to your customer support case.
65+
. Launch a web browser and navigate to the URL to view the data by using the Prometheus web console.
66+
. After you have viewed the data, delete the Prometheus instance and data:
67+
+
68+
[source,terminal]
69+
----
70+
$ make prometheus-cleanup
71+
----

0 commit comments

Comments
 (0)