|
4 | 4 | // * migration-toolkit-for-containers/troubleshooting-mtc |
5 | 5 |
|
6 | 6 | [id="migration-using-must-gather_{context}"] |
7 | | -= Using must-gather to collect data |
8 | 7 |
|
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}). |
10 | 8 |
|
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. |
12 | 22 |
|
13 | 23 | .Procedure |
14 | 24 |
|
15 | 25 | . 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: |
17 | 29 | + |
18 | 30 | [source,terminal,subs="attributes+"] |
19 | 31 | ---- |
20 | 32 | $ oc adm must-gather --image=registry.redhat.io/rhmtc/openshift-migration-must-gather-rhel8:v{mtc-version} |
21 | 33 | ---- |
| 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 |
22 | 49 |
|
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: |
25 | 58 | + |
| 59 | +.Output |
26 | 60 | [source,terminal] |
27 | 61 | ---- |
28 | | -$ tar cvaf must-gather.tar.gz must-gather.local.<uid>/ |
| 62 | +Started Prometheus on http://localhost:9090 |
29 | 63 | ---- |
30 | 64 |
|
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