Skip to content

Commit 7f213e1

Browse files
authored
Merge pull request #85651 from eromanova97/OBSDOCS-1478
OBSDOCS-1478: Ability to modify UWM Prometheus scrape interval
2 parents df74e6b + 0fadcc2 commit 7f213e1

5 files changed

+33
-29
lines changed

modules/monitoring-limiting-scrape-samples-in-user-defined-projects.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ can use the following measures to control the impact of unbound metrics attribut
2020

2121
* Limit the number of samples that can be accepted per target scrape in user-defined projects
2222
* Limit the number of scraped labels, the length of label names, and the length of label values
23+
* Configure the intervals between consecutive scrapes and between Prometheus rule evaluations
2324
* Create alerts that fire when a scrape sample threshold is reached or when the target cannot be scraped
2425
2526
[NOTE]

modules/monitoring-setting-scrape-sample-and-label-limits-for-user-defined-projects.adoc renamed to modules/monitoring-setting-scrape-and-evaluation-intervals-limits-for-user-defined-projects.adoc

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@
33
// * observability/monitoring/configuring-the-monitoring-stack.adoc
44

55
:_mod-docs-content-type: PROCEDURE
6-
[id="setting-scrape-sample-and-label-limits-for-user-defined-projects_{context}"]
7-
= Setting scrape sample and label limits for user-defined projects
6+
[id="setting-scrape-and-evaluation-intervals-limits-for-user-defined-projects_{context}"]
7+
= Setting scrape intervals, evaluation intervals, and enforced limits for user-defined projects
88

9-
You can limit the number of samples that can be accepted per target scrape in user-defined projects. You can also limit the number of scraped labels, the length of label names, and the length of label values.
9+
You can set the following scrape and label limits for user-defined projects:
10+
11+
* Limit the number of samples that can be accepted per target scrape
12+
* Limit the number of scraped labels
13+
* Limit the length of label names and label values
14+
15+
You can also set an interval between consecutive scrapes and between Prometheus rule evaluations.
1016

1117
[WARNING]
1218
====
@@ -34,7 +40,7 @@ endif::openshift-dedicated,openshift-rosa[]
3440
$ oc -n openshift-user-workload-monitoring edit configmap user-workload-monitoring-config
3541
----
3642

37-
. Add the `enforcedSampleLimit` configuration to `data/config.yaml` to limit the number of samples that can be accepted per target scrape in user-defined projects:
43+
. Add the enforced limit and time interval configurations to `data/config.yaml`:
3844
+
3945
[source,yaml]
4046
----
@@ -46,31 +52,28 @@ metadata:
4652
data:
4753
config.yaml: |
4854
prometheus:
49-
enforcedSampleLimit: 50000 <1>
55+
enforcedSampleLimit: 50000 # <1>
56+
enforcedLabelLimit: 500 # <2>
57+
enforcedLabelNameLengthLimit: 50 # <3>
58+
enforcedLabelValueLengthLimit: 600 # <4>
59+
scrapeInterval: 1m30s # <5>
60+
evaluationInterval: 1m15s # <6>
5061
----
5162
<1> A value is required if this parameter is specified. This `enforcedSampleLimit` example limits the number of samples that can be accepted per target scrape in user-defined projects to 50,000.
52-
53-
. Add the `enforcedLabelLimit`, `enforcedLabelNameLengthLimit`, and `enforcedLabelValueLengthLimit` configurations to `data/config.yaml` to limit the number of scraped labels, the length of label names, and the length of label values in user-defined projects:
54-
+
55-
[source,yaml]
56-
----
57-
apiVersion: v1
58-
kind: ConfigMap
59-
metadata:
60-
name: user-workload-monitoring-config
61-
namespace: openshift-user-workload-monitoring
62-
data:
63-
config.yaml: |
64-
prometheus:
65-
enforcedLabelLimit: 500 <1>
66-
enforcedLabelNameLengthLimit: 50 <2>
67-
enforcedLabelValueLengthLimit: 600 <3>
68-
----
69-
<1> Specifies the maximum number of labels per scrape.
63+
<2> Specifies the maximum number of labels per scrape.
7064
The default value is `0`, which specifies no limit.
71-
<2> Specifies the maximum length in characters of a label name.
65+
<3> Specifies the maximum character length for a label name.
7266
The default value is `0`, which specifies no limit.
73-
<3> Specifies the maximum length in characters of a label value.
67+
<4> Specifies the maximum character length for a label value.
7468
The default value is `0`, which specifies no limit.
69+
<5> Specifies the interval between consecutive scrapes. The interval must be set between 5 seconds and 5 minutes.
70+
The default value is `30s`.
71+
<6> Specifies the interval between Prometheus rule evaluations. The interval must be set between 5 seconds and 5 minutes.
72+
The default value for Prometheus is `30s`.
73+
+
74+
[NOTE]
75+
====
76+
You can also configure the `evaluationInterval` property for Thanos Ruler through the `data/config.yaml/thanosRuler` field. The default value for Thanos Ruler is `15s`.
77+
====
7578

7679
. Save the file to apply the changes. The limits are applied automatically.

observability/monitoring/configuring-the-monitoring-stack.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ include::modules/monitoring-choosing-a-metrics-collection-profile.adoc[leveloffs
248248
* See xref:../../nodes/clusters/nodes-cluster-enabling-features.adoc[Enabling features using feature gates] for steps to enable Technology Preview features.
249249
endif::openshift-dedicated,openshift-rosa[]
250250

251-
// Managing scrape sample limits for user-defined projects
251+
// Managing scrape and evaluation intervals and enforced limits for user-defined projects
252252
include::modules/monitoring-limiting-scrape-samples-in-user-defined-projects.adoc[leveloffset=+1]
253-
include::modules/monitoring-setting-scrape-sample-and-label-limits-for-user-defined-projects.adoc[leveloffset=+2]
253+
include::modules/monitoring-setting-scrape-and-evaluation-intervals-limits-for-user-defined-projects.adoc[leveloffset=+2]
254254
ifndef::openshift-dedicated,openshift-rosa[]
255255
include::modules/monitoring-creating-scrape-sample-alerts.adoc[leveloffset=+2]
256256

observability/monitoring/troubleshooting-monitoring-issues.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ include::modules/monitoring-determining-why-prometheus-is-consuming-disk-space.a
3737
.Additional resources
3838

3939
* xref:../../observability/monitoring/accessing-third-party-monitoring-apis.adoc#about-accessing-monitoring-web-service-apis_accessing-monitoring-apis-by-using-the-cli[Accessing monitoring APIs by using the CLI]
40-
* xref:../../observability/monitoring/configuring-the-monitoring-stack.adoc#setting-scrape-sample-and-label-limits-for-user-defined-projects_configuring-the-monitoring-stack[Setting a scrape sample limit for user-defined projects]
40+
* xref:../../observability/monitoring/configuring-the-monitoring-stack.adoc#setting-scrape-and-evaluation-intervals-limits-for-user-defined-projects_configuring-the-monitoring-stack[Setting scrape intervals, evaluation intervals, and scrape limits for user-defined projects]
4141
* xref:../../support/getting-support.adoc#support-submitting-a-case_getting-support[Submitting a support case]
4242
4343
// Resolving the KubePersistentVolumeFillingUp alert firing for Prometheus

support/troubleshooting/investigating-monitoring-issues.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ include::modules/monitoring-determining-why-prometheus-is-consuming-disk-space.a
3131
[role="_additional-resources"]
3232
.Additional resources
3333

34-
* See xref:../../observability/monitoring/configuring-the-monitoring-stack.adoc#setting-scrape-sample-and-label-limits-for-user-defined-projects_configuring-the-monitoring-stack[Setting a scrape sample limit for user-defined projects] for details on how to set a scrape sample limit and create related alerting rules
34+
* xref:../../observability/monitoring/configuring-the-monitoring-stack.adoc#setting-scrape-and-evaluation-intervals-limits-for-user-defined-projects_configuring-the-monitoring-stack[Setting scrape and evaluation intervals and enforced limits for user-defined projects]
3535
3636
// Resolving the KubePersistentVolumeFillingUp alert firing for Prometheus
3737
include::modules/monitoring-resolving-the-kubepersistentvolumefillingup-alert-firing-for-prometheus.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)