Skip to content

Commit 75e9af9

Browse files
authored
Merge pull request #56073 from bburt-rh/RHDEVDOCS-4340-document-scrape-profiles-in-CMO
RHDEVDOCS-4340-document-scrape-profiles-in-CMO
2 parents 096b830 + c9be365 commit 75e9af9

File tree

3 files changed

+112
-0
lines changed

3 files changed

+112
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * monitoring/configuring-the-monitoring-stack.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="configuring-metrics-collection-profiles_{context}"]
7+
= Configuring metrics collection profiles
8+
9+
[IMPORTANT]
10+
====
11+
[subs="attributes+"]
12+
Using a metrics collection profile is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete.
13+
Red Hat does not recommend using them in production.
14+
These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
15+
16+
For more information about the support scope of Red Hat Technology Preview features, see link:https://access.redhat.com/support/offerings/techpreview[https://access.redhat.com/support/offerings/techpreview].
17+
====
18+
19+
By default, Prometheus collects metrics exposed by all default metrics targets in {product-title} components.
20+
However, you might want Prometheus to collect fewer metrics from a cluster in certain scenarios:
21+
22+
* If cluster administrators require only alert, telemetry, and console metrics and do not require other metrics to be available.
23+
* If a cluster increases in size, and the increased size of the default metrics data collected now requires a significant increase in CPU and memory resources.
24+
25+
You can use a metrics collection profile to collect either the default amount of metrics data or a minimal amount of metrics data.
26+
When you collect minimal metrics data, basic monitoring features such as alerting continue to work.
27+
At the same time, the CPU and memory resources required by Prometheus decrease.
28+
29+
[id="about-metrics-collection-profiles_{context}"]
30+
== About metrics collection profiles
31+
32+
You can enable one of two metrics collection profiles:
33+
34+
* *full*: Prometheus collects metrics data exposed by all platform components. This setting is the default.
35+
* *minimal*: Prometheus collects only the metrics data required for platform alerts, recording rules, telemetry, and console dashboards.

monitoring/configuring-the-monitoring-stack.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,16 @@ include::modules/monitoring-creating-cluster-id-labels-for-metrics.adoc[leveloff
116116

117117
* For details about write relabel configuration, see xref:../monitoring/configuring-the-monitoring-stack.adoc#configuring_remote_write_storage_configuring-the-monitoring-stack[Configuring remote write storage].
118118

119+
// Configuring metrics collection profiles
120+
include::modules/monitoring-configuring-metrics-collection-profiles.adoc[leveloffset=+1]
121+
include::modules/monitoring-choosing-a-metrics-collection-profile.adoc[leveloffset=+2]
122+
123+
[role="_additional-resources"]
124+
.Additional resources
125+
126+
* See xref:../monitoring/managing-metrics.adoc#viewing-a-list-of-available-metrics_managing-metrics[Viewing a list of available metrics] for steps to view a list of metrics being collected for a cluster.
127+
* See xref:../nodes/clusters/nodes-cluster-enabling-features.adoc[Enabling features using feature gates] for steps to enable Technology Preview features.
128+
119129
// Managing scrape sample limits for user-defined projects
120130
include::modules/monitoring-limiting-scrape-samples-in-user-defined-projects.adoc[leveloffset=+1]
121131
include::modules/monitoring-setting-scrape-sample-and-label-limits-for-user-defined-projects.adoc[leveloffset=+2]

0 commit comments

Comments
 (0)