|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * monitoring/configuring-the-monitoring-stack.adoc |
| 4 | + |
| 5 | +:_content-type: PROCEDURE |
| 6 | +[id="choosing-a-metrics-collection-profile_{context}"] |
| 7 | += Choosing a metrics collection profile |
| 8 | + |
| 9 | +To choose a metrics collection profile for core {product-title} monitoring components, edit the `cluster-monitoring-config` `ConfigMap` object. |
| 10 | + |
| 11 | +.Prerequisites |
| 12 | + |
| 13 | +* You have installed the OpenShift CLI (`oc`). |
| 14 | +* You have enabled Technology Preview features by using the `FeatureGate` custom resource (CR). |
| 15 | +* You have created the `cluster-monitoring-config` `ConfigMap` object. |
| 16 | +* You have access to the cluster as a user with the `cluster-admin` role. |
| 17 | +
|
| 18 | +[WARNING] |
| 19 | +==== |
| 20 | +Saving changes to a monitoring config map might restart monitoring processes and redeploy the pods and other resources in the related project. |
| 21 | +The running monitoring processes in that project might also restart. |
| 22 | +==== |
| 23 | + |
| 24 | +.Procedure |
| 25 | + |
| 26 | +. Edit the `cluster-monitoring-config` `ConfigMap` object in the `openshift-monitoring` project: |
| 27 | ++ |
| 28 | +[source,terminal] |
| 29 | +---- |
| 30 | +$ oc -n openshift-monitoring edit configmap cluster-monitoring-config |
| 31 | +---- |
| 32 | + |
| 33 | +. Add the metrics collection profile setting under `data/config.yaml/prometheusK8s`: |
| 34 | ++ |
| 35 | +[source,yaml] |
| 36 | +---- |
| 37 | +apiVersion: v1 |
| 38 | +kind: ConfigMap |
| 39 | +metadata: |
| 40 | + name: cluster-monitoring-config |
| 41 | + namespace: openshift-monitoring |
| 42 | +data: |
| 43 | + config.yaml: | |
| 44 | + prometheusK8s: |
| 45 | + collectionProfile: <metrics_collection_profile_name> <1> |
| 46 | +---- |
| 47 | ++ |
| 48 | +<1> The name of the metrics collection profile. |
| 49 | +The available values are `full` or `minimal`. |
| 50 | +If you do not specify a value or if the `collectionProfile` key name does not exist in the config map, the default setting of `full` is used. |
| 51 | ++ |
| 52 | +The following example sets the metrics collection profile to `minimal` for the core platform instance of Prometheus: |
| 53 | ++ |
| 54 | +[source,yaml,subs=quotes] |
| 55 | +---- |
| 56 | +apiVersion: v1 |
| 57 | +kind: ConfigMap |
| 58 | +metadata: |
| 59 | + name: cluster-monitoring-config |
| 60 | + namespace: openshift-monitoring |
| 61 | +data: |
| 62 | + config.yaml: | |
| 63 | + prometheusK8s: |
| 64 | + collectionProfile: *minimal* |
| 65 | +---- |
| 66 | + |
| 67 | +. Save the file to apply the changes. The pods affected by the new configuration restart automatically. |
0 commit comments