|
25 | 25 | :component-name: Thanos Ruler
|
26 | 26 | // end::UWM[]
|
27 | 27 |
|
| 28 | +// tag::CPM[] |
| 29 | +You can configure the log level for Alertmanager, Prometheus Operator, Prometheus, and {component-name} and log verbosity for Metrics Server. |
| 30 | +// end::CPM[] |
| 31 | +// tag::UWM[] |
28 | 32 | You can configure the log level for Alertmanager, Prometheus Operator, Prometheus, and {component-name}.
|
29 |
| - |
| 33 | +// end::UWM[] |
| 34 | +You can use these settings for troubleshooting and to gain better insight into how the components are functioning. |
30 | 35 |
|
31 | 36 | The following log levels can be applied to the relevant component in the `{configmap-name}` `ConfigMap` object:
|
32 | 37 |
|
33 | 38 | * `debug`. Log debug, informational, warning, and error messages.
|
34 |
| -* `info`. Log informational, warning, and error messages. |
| 39 | +* `info` (default). Log informational, warning, and error messages. |
35 | 40 | * `warn`. Log warning and error messages only.
|
36 | 41 | * `error`. Log error messages only.
|
37 | 42 |
|
38 |
| -The default log level is `info`. |
39 |
| - |
40 |
| -// tag::CPM[] |
41 |
| -[NOTE] |
42 |
| -==== |
43 |
| -The Metrics Server component uses a different logging configuration method. For more information, see "Setting log verbosity for Metrics Server". |
44 |
| -==== |
45 |
| -// end::CPM[] |
46 |
| - |
47 | 43 | .Prerequisites
|
48 | 44 |
|
49 | 45 | // tag::CPM[]
|
@@ -85,30 +81,57 @@ data:
|
85 | 81 | config.yaml: |
|
86 | 82 | <component>: # <1>
|
87 | 83 | logLevel: <log_level> # <2>
|
| 84 | +# tag::CPM[] |
| 85 | + metricsServer: |
| 86 | + verbosity: <value> # <3> |
| 87 | +# end::CPM[] |
| 88 | + # ... |
88 | 89 | ----
|
89 |
| -<1> The monitoring stack component for which you are setting a log level. |
| 90 | +<1> Specify the monitoring stack component for which you are setting a log level. |
90 | 91 | Available component values are `{prometheus}`, `{alertmanager}`, `prometheusOperator`, and `{thanos}`.
|
91 |
| -<2> The log level to set for the component. |
| 92 | +<2> Specify the log level for the component. |
92 | 93 | The available values are `error`, `warn`, `info`, and `debug`.
|
93 | 94 | The default value is `info`.
|
| 95 | +// tag::CPM[] |
| 96 | +<3> Specify the verbosity for the Metrics Server. |
| 97 | +Valid values are positive integers. |
| 98 | +Increasing the number increases the amount of logged events, values over `10` are usually unnecessary. |
| 99 | +The default value is `0`. |
| 100 | +// end::CPM[] |
94 | 101 |
|
95 | 102 | . Save the file to apply the changes. The pods affected by the new configuration are automatically redeployed.
|
96 | 103 |
|
97 |
| -. Confirm that the log level has been applied by reviewing the deployment or pod configuration in the related project. |
98 |
| -The following example checks the log level for the `prometheus-operator` deployment: |
| 104 | +. Verify that the log configuration is applied by reviewing the deployment or pod configuration in the related project. |
| 105 | + |
| 106 | +** The following example checks the log level for the `prometheus-operator` deployment: |
99 | 107 | +
|
100 | 108 | [source,terminal,subs="attributes+"]
|
101 | 109 | ----
|
102 | 110 | $ oc -n {namespace-name} get deploy prometheus-operator -o yaml | grep "log-level"
|
103 | 111 | ----
|
104 | 112 | +
|
105 | 113 | .Example output
|
106 |
| -[source,terminal,subs="attributes+"] |
| 114 | +[source,terminal] |
107 | 115 | ----
|
108 | 116 | - --log-level=debug
|
109 | 117 | ----
|
110 | 118 |
|
111 |
| -. Check that the pods for the component are running. The following example lists the status of pods: |
| 119 | +// tag::CPM[] |
| 120 | +** The following example checks the log verbosity for the `metrics-server` deployment: |
| 121 | ++ |
| 122 | +[source,terminal] |
| 123 | +---- |
| 124 | +$ oc -n openshift-monitoring get deploy metrics-server -o yaml | grep -- --v= |
| 125 | +---- |
| 126 | ++ |
| 127 | +.Example output |
| 128 | +[source,terminal] |
| 129 | +---- |
| 130 | + - --v=3 |
| 131 | +---- |
| 132 | +// end::CPM[] |
| 133 | + |
| 134 | +. Verify that the pods for the component are running: |
112 | 135 | +
|
113 | 136 | [source,terminal,subs="attributes+"]
|
114 | 137 | ----
|
|
0 commit comments