You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
. Add `profile:` in the `k8sPrometheusAdapter/audit` section under `data/config.yaml`:
30
+
+
31
+
[source,yaml]
32
+
----
33
+
apiVersion: v1
34
+
kind: ConfigMap
35
+
metadata:
36
+
name: cluster-monitoring-config
37
+
namespace: openshift-monitoring
38
+
data:
39
+
config.yaml: |
40
+
k8sPrometheusAdapter:
41
+
audit:
42
+
profile: <audit_log_level> <1>
43
+
----
44
+
<1> The audit log level to apply to the Prometheus Adapter.
45
+
46
+
. Set the audit log level by using one of the following values for the `profile:` parameter:
47
+
+
48
+
* `None`: Do not log events.
49
+
* `Metadata`: Log only the metadata for the request, such as user, timestamp, and so forth. Do not log the request text and the response text. `Metadata` is the default audit log level.
50
+
* `Request`: Log only the metadata and the request text but not the response text. This option does not apply for non-resource requests.
51
+
* `RequestResponse`: Log event metadata, request text, and response text. This option does not apply for non-resource requests.
52
+
53
+
. Save the file to apply the changes. The pods for the Prometheus Adapter restart automatically when you apply the change.
54
+
+
55
+
[WARNING]
56
+
====
57
+
When changes are saved to a monitoring config map, the pods and other resources in the related project might be redeployed. The running monitoring processes in that project might also be restarted.
58
+
====
59
+
60
+
.Verification
61
+
62
+
. In the config map, under `k8sPrometheusAdapter/audit/profile`, set the log level to `Request` and save the file.
63
+
64
+
. Confirm that the pods for the Prometheus Adapter are running. The following example lists the status of pods in the `openshift-monitoring` project:
65
+
+
66
+
[source,terminal]
67
+
----
68
+
$ oc -n openshift-monitoring get pods
69
+
----
70
+
71
+
. Confirm that the audit log level and audit log file path are correctly configured:
72
+
+
73
+
[source,terminal]
74
+
----
75
+
$ oc -n openshift-monitoring get deploy prometheus-adapter -o yaml
If you enter an unrecognized `profile` value for the Prometheus Adapter in the `ConfigMap` object, no changes are made to the Prometheus Adapter, and an error is logged by the Cluster Monitoring Operator.
109
+
====
110
+
111
+
. Review the audit log for the Prometheus Adapter:
* See xref:../monitoring/configuring-the-monitoring-stack.adoc#preparing-to-configure-the-monitoring-stack[Preparing to configure the monitoring stack] for steps to create monitoring config maps
104
+
* See xref:../monitoring/configuring-the-monitoring-stack.adoc#preparing-to-configure-the-monitoring-stack[Preparing to configure the monitoring stack] for steps to create monitoring config maps.
105
105
* xref:../monitoring/enabling-monitoring-for-user-defined-projects.adoc#enabling-monitoring-for-user-defined-projects[Enabling monitoring for user-defined projects]
* xref:../monitoring/configuring-the-monitoring-stack.adoc#creating-user-defined-workload-monitoring-configmap_configuring-the-monitoring-stack[Creating a user-defined workload monitoring config map]
128
128
* xref:../monitoring/enabling-monitoring-for-user-defined-projects.adoc#enabling-monitoring-for-user-defined-projects[Enabling monitoring for user-defined projects]
129
-
* See xref:../monitoring/troubleshooting-monitoring-issues.html#determining-why-prometheus-is-consuming-disk-space_troubleshooting-monitoring-issues[Determining why Prometheus is consuming a lot of disk space] for steps to query which metrics have the highest number of scrape samples
129
+
* See xref:../monitoring/troubleshooting-monitoring-issues.html#determining-why-prometheus-is-consuming-disk-space_troubleshooting-monitoring-issues[Determining why Prometheus is consuming a lot of disk space] for steps to query which metrics have the highest number of scrape samples.
* See xref:../monitoring/configuring-the-monitoring-stack.adoc#preparing-to-configure-the-monitoring-stack[Preparing to configure the monitoring stack] for steps to create monitoring config maps
140
+
* See xref:../monitoring/configuring-the-monitoring-stack.adoc#preparing-to-configure-the-monitoring-stack[Preparing to configure the monitoring stack] for steps to create monitoring config maps.
141
141
* xref:../monitoring/enabling-monitoring-for-user-defined-projects.adoc#enabling-monitoring-for-user-defined-projects[Enabling monitoring for user-defined projects]
* See xref:../monitoring/configuring-the-monitoring-stack.adoc#preparing-to-configure-the-monitoring-stack[Preparing to configure the monitoring stack] for steps to create monitoring config maps.
162
+
163
+
// Setting audit log levels for the Prometheus Adapter
* See xref:../monitoring/configuring-the-monitoring-stack.adoc#preparing-to-configure-the-monitoring-stack[Preparing to configure the monitoring stack] for steps to create monitoring config maps.
* See xref:../monitoring/configuring-the-monitoring-stack.adoc#preparing-to-configure-the-monitoring-stack[Preparing to configure the monitoring stack] for steps to create monitoring config maps
177
+
* See xref:../monitoring/configuring-the-monitoring-stack.adoc#preparing-to-configure-the-monitoring-stack[Preparing to configure the monitoring stack] for steps to create monitoring config maps.
* xref:../monitoring/enabling-monitoring-for-user-defined-projects.adoc#enabling-monitoring-for-user-defined-projects[Enabling monitoring for user-defined projects]
179
-
* Learn about xref:../support/remote_health_monitoring/opting-out-of-remote-health-reporting.adoc#opting-out-remote-health-reporting_opting-out-remote-health-reporting[remote health reporting] and, if necessary, opt out of it
190
+
* Learn about xref:../support/remote_health_monitoring/opting-out-of-remote-health-reporting.adoc#opting-out-remote-health-reporting_opting-out-remote-health-reporting[remote health reporting] and, if necessary, opt out of it.
0 commit comments