2525:component-name: Thanos Ruler
2626// end::UWM[]
2727
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[]
2832You 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.
3035
3136The following log levels can be applied to the relevant component in the `{configmap-name}` `ConfigMap` object:
3237
3338* `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.
3540* `warn` . Log warning and error messages only.
3641* `error` . Log error messages only.
3742
38- The default log level is `info` .
39-
4043.Prerequisites
4144
4245// tag::CPM[]
@@ -65,7 +68,7 @@ endif::openshift-dedicated,openshift-rosa[]
6568$ oc -n {namespace-name} edit configmap {configmap-name}
6669----
6770
68- . Add `logLevel: <log_level>` for a component under `data/config.yaml` :
71+ . Add log configuration for a component under `data/config.yaml` :
6972+
7073[source,yaml,subs="attributes+"]
7174----
@@ -78,30 +81,57 @@ data:
7881 config.yaml: |
7982 <component >: # <1>
8083 logLevel: <log _level > # <2>
84+ # tag::CPM[]
85+ metricsServer:
86+ verbosity: <value > # <3>
87+ # end::CPM[]
88+ # ...
8189----
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.
8391Available 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.
8593The available values are `error` , `warn` , `info` , and `debug` .
8694The 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[]
87101
88102. Save the file to apply the changes. The pods affected by the new configuration are automatically redeployed.
89103
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:
92107+
93108[source,terminal,subs="attributes+"]
94109----
95110$ oc -n {namespace-name} get deploy prometheus-operator -o yaml | grep "log-level"
96111----
97112+
98113.Example output
99- [source,terminal,subs="attributes+" ]
114+ [source,terminal]
100115----
101116 - --log-level=debug
102117----
103118
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:
105135+
106136[source,terminal,subs="attributes+"]
107137----
0 commit comments