Skip to content

Commit 19adfb5

Browse files
authored
Merge pull request #48050 from bburt-rh/RHDEVDOCS-3956-document-per-label-scrape-limit-settings-for-UWM
RHDEVDOCS-3956 - document per label scrape limit settings for UWM
2 parents 5c86b64 + 5c2abaf commit 19adfb5

5 files changed

+39
-12
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,22 @@
22
//
33
// * monitoring/configuring-the-monitoring-stack.adoc
44

5+
:_content-type: CONCEPT
56
[id="controlling-the-impact-of-unbound-attributes-in-user-defined-projects_{context}"]
67
= Controlling the impact of unbound metrics attributes in user-defined projects
78

89
Developers can create labels to define attributes for metrics in the form of key-value pairs. The number of potential key-value pairs corresponds to the number of possible values for an attribute. An attribute that has an unlimited number of potential values is called an unbound attribute. For example, a `customer_id` attribute is unbound because it has an infinite number of possible values.
910

10-
Every assigned key-value pair has a unique time series. The use of many unbound attributes in labels can result in an exponential increase in the number of time series created. This can impact Prometheus performance and can consume a lot of disk space.
11+
Every assigned key-value pair has a unique time series. Using many unbound attributes in labels can create exponentially more time series, which can impact Prometheus performance and available disk space.
1112

1213
Cluster administrators can use the following measures to control the impact of unbound metrics attributes in user-defined projects:
1314

14-
* *Limit the number of samples that can be accepted* per target scrape in user-defined projects
15-
* *Create alerts* that fire when a scrape sample threshold is reached or when the target cannot be scraped
15+
* Limit the number of samples that can be accepted per target scrape in user-defined projects
16+
* Limit the number of scraped labels, the length of label names, and the length of label values.
17+
* Create alerts that fire when a scrape sample threshold is reached or when the target cannot be scraped
1618
1719
[NOTE]
1820
====
19-
Limiting scrape samples can help prevent the issues caused by adding many unbound attributes to labels. Developers can also prevent the underlying cause by limiting the number of unbound attributes that they define for metrics. Using attributes that are bound to a limited set of possible values reduces the number of potential key-value pair combinations.
21+
To prevent issues caused by adding many unbound attributes, limit the number of scrape samples, label names, and unbound attributes you define for metrics.
22+
Also reduce the number of potential key-value pair combinations by using attributes that are bound to a limited set of possible values.
2023
====

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

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@
33
// * monitoring/configuring-the-monitoring-stack.adoc
44

55
:_content-type: PROCEDURE
6-
[id="setting-a-scrape-sample-limit-for-user-defined-projects_{context}"]
7-
= Setting a scrape sample limit for user-defined projects
6+
[id="setting-scrape-sample-and-label-limits-for-user-defined-projects_{context}"]
7+
= Setting scrape sample and label limits for user-defined projects
88

99
You can limit the number of samples that can be accepted per target scrape in user-defined projects.
10+
You can also limit the number of scraped labels, the length of label names, and the length of label values.
1011

1112
[WARNING]
1213
====
13-
If you set a sample limit, no further sample data is ingested for that target scrape after the limit is reached.
14+
If you set sample or label limits, no further sample data is ingested for that target scrape after the limit is reached.
1415
====
1516

1617
.Prerequisites
1718

1819
* You have access to the cluster as a user with the `cluster-admin` role, or as a user with the `user-workload-monitoring-config-edit` role in the `openshift-user-workload-monitoring` project.
19-
* You have created the `user-workload-monitoring-config` `ConfigMap` object.
20+
* You have enabled monitoring for user-defined projects.
2021
* You have installed the OpenShift CLI (`oc`).
2122
2223
.Procedure
@@ -44,7 +45,30 @@ data:
4445
----
4546
<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.
4647

47-
. Save the file to apply the changes. The limit is applied automatically.
48+
. 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:
49+
+
50+
[source,yaml]
51+
----
52+
apiVersion: v1
53+
kind: ConfigMap
54+
metadata:
55+
name: user-workload-monitoring-config
56+
namespace: openshift-user-workload-monitoring
57+
data:
58+
config.yaml: |
59+
prometheus:
60+
enforcedLabelLimit: 500 <1>
61+
enforcedLabelNameLengthLimit: 50 <2>
62+
enforcedLabelValueLengthLimit: 600 <3>
63+
----
64+
<1> Specifies the maximum number of labels per scrape.
65+
The default value is `0`, which specifies no limit.
66+
<2> Specifies the maximum length in characters of a label name.
67+
The default value is `0`, which specifies no limit.
68+
<3> Specifies the maximum length in characters of a label value.
69+
The default value is `0`, which specifies no limit.
70+
71+
. Save the file to apply the changes. The limits are applied automatically.
4872
+
4973
[NOTE]
5074
====

monitoring/configuring-the-monitoring-stack.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ include::modules/monitoring-creating-cluster-id-labels-for-metrics.adoc[leveloff
108108

109109
// Managing scrape sample limits for user-defined projects
110110
include::modules/monitoring-limiting-scrape-samples-in-user-defined-projects.adoc[leveloffset=+1]
111-
include::modules/monitoring-setting-a-scrape-sample-limit-for-user-defined-projects.adoc[leveloffset=+2]
111+
include::modules/monitoring-setting-scrape-sample-and-label-limits-for-user-defined-projects.adoc[leveloffset=+2]
112112
include::modules/monitoring-creating-scrape-sample-alerts.adoc[leveloffset=+2]
113113

114114
[role="_additional-resources"]

monitoring/troubleshooting-monitoring-issues.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ include::modules/monitoring-determining-why-prometheus-is-consuming-disk-space.a
2323
[role="_additional-resources"]
2424
.Additional resources
2525

26-
* See xref:../monitoring/configuring-the-monitoring-stack.adoc#setting-a-scrape-sample-limit-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
26+
* See xref:../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
2727
* xref:../support/getting-support.html#support-submitting-a-case_getting-support[Submitting a support case]

support/troubleshooting/investigating-monitoring-issues.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ include::modules/monitoring-determining-why-prometheus-is-consuming-disk-space.a
2727
[role="_additional-resources"]
2828
.Additional resources
2929

30-
* See xref:../../monitoring/configuring-the-monitoring-stack.adoc#setting-a-scrape-sample-limit-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
30+
* See xref:../../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

0 commit comments

Comments
 (0)