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
43
.Prerequisites
41
44
42
45
// tag::CPM[]
@@ -65,7 +68,7 @@ endif::openshift-dedicated,openshift-rosa[]
65
68
$ oc -n {namespace-name} edit configmap {configmap-name}
66
69
----
67
70
68
- . Add `logLevel: <log_level>` for a component under `data/config.yaml` :
71
+ . Add log configuration for a component under `data/config.yaml` :
69
72
+
70
73
[source,yaml,subs="attributes+"]
71
74
----
@@ -78,30 +81,57 @@ data:
78
81
config.yaml: |
79
82
<component >: # <1>
80
83
logLevel: <log _level > # <2>
84
+ # tag::CPM[]
85
+ metricsServer:
86
+ verbosity: <value > # <3>
87
+ # end::CPM[]
88
+ # ...
81
89
----
82
- <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.
83
91
Available component values are `{prometheus}` , `{alertmanager}` , `prometheusOperator` , and `{thanos}` .
84
- <2> The log level to set for the component.
92
+ <2> Specify the log level for the component.
85
93
The available values are `error` , `warn` , `info` , and `debug` .
86
94
The default value is `info` .
95
+ // tag::CPM[]
96
+ <3> Specify the verbosity for 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[]
87
101
88
102
. Save the file to apply the changes. The pods affected by the new configuration are automatically redeployed.
89
103
90
- . Confirm that the log level has been applied by reviewing the deployment or pod configuration in the related project.
91
- 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:
92
107
+
93
108
[source,terminal,subs="attributes+"]
94
109
----
95
110
$ oc -n {namespace-name} get deploy prometheus-operator -o yaml | grep "log-level"
96
111
----
97
112
+
98
113
.Example output
99
- [source,terminal,subs="attributes+" ]
114
+ [source,terminal]
100
115
----
101
116
- --log-level=debug
102
117
----
103
118
104
- . 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:
105
135
+
106
136
[source,terminal,subs="attributes+"]
107
137
----
0 commit comments