Skip to content

Commit e6525ed

Browse files
committed
OBSDOCS-1938: Show how to increase metrics-server verbosity
1 parent 3392c2e commit e6525ed

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed

modules/monitoring-setting-log-levels-for-monitoring-components.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ The following log levels can be applied to the relevant component in the `{confi
3737
3838
The default log level is `info`.
3939

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+
4047
.Prerequisites
4148

4249
// tag::CPM[]
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * observability/monitoring/configuring-core-platform-monitoring/storing-and-recording-data.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="setting-log-verbosity-for-metrics-server_{context}"]
7+
= Setting log verbosity for Metrics Server
8+
9+
You can configure the log verbosity for the Metrics Server component to control the level of detail in the log output. You can use this setting for troubleshooting and better insight into how the Metrics Server is functioning.
10+
11+
[NOTE]
12+
====
13+
Setting a higher verbosity level can help diagnose issues, but it might increase log volume significantly.
14+
====
15+
16+
.Prerequisites
17+
18+
* You have access to the cluster as a user with the `cluster-admin` cluster role.
19+
* You have created the `cluster-monitoring-config` `ConfigMap` object.
20+
* You have installed the OpenShift CLI (`oc`).
21+
22+
.Procedure
23+
24+
. Edit the `cluster-monitoring-config` config map in the `openshift-monitoring` project:
25+
+
26+
[source,terminal]
27+
----
28+
$ oc -n openshift-monitoring edit configmap cluster-monitoring-config
29+
----
30+
31+
. Add the `verbosity` parameter under `data/config.yaml/metricsServer`:
32+
+
33+
.Example verbosity setting for Metrics Server
34+
[source,yaml]
35+
----
36+
apiVersion: v1
37+
kind: ConfigMap
38+
metadata:
39+
name: cluster-monitoring-config
40+
namespace: openshift-monitoring
41+
data:
42+
config.yaml: |
43+
metricsServer:
44+
verbosity: 3 # <1>
45+
# ...
46+
----
47+
<1> Valid values are positive integers. Increasing the value increases the number of logged events, values over `10` are usually unnecessary. The default value is `0`.
48+
49+
. Save the file to apply the changes. The pods affected by the new configuration are automatically redeployed.
50+
51+
. Verify that the log verbosity is applied by running the following command:
52+
+
53+
[source,terminal]
54+
----
55+
$ oc -n openshift-monitoring get pod <metrics_server_pod_name> -o yaml | grep -- --v=
56+
----
57+
+
58+
.Example output
59+
[source,terminal]
60+
----
61+
- --v=3
62+
----

observability/monitoring/configuring-core-platform-monitoring/storing-and-recording-data.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ include::modules/monitoring-modifying-retention-time-and-size-for-prometheus-met
4444
// Configuring audit logs for Metrics Server
4545
include::modules/monitoring-configuring-audit-logs-for-metrics-server.adoc[leveloffset=+1]
4646

47+
// Setting log verbosity for Metrics Server
48+
include::modules/monitoring-setting-log-verbosity-for-metrics-server.adoc[leveloffset=+1]
49+
4750
// Setting log levels for monitoring components
4851
include::modules/monitoring-setting-log-levels-for-monitoring-components.adoc[leveloffset=+1,tags=**;CPM;!UWM]
4952

0 commit comments

Comments
 (0)