|
3 | 3 | // * monitoring/configuring-the-monitoring-stack.adoc
|
4 | 4 |
|
5 | 5 | :_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 |
8 | 8 |
|
9 | 9 | 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. |
10 | 11 |
|
11 | 12 | [WARNING]
|
12 | 13 | ====
|
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. |
14 | 15 | ====
|
15 | 16 |
|
16 | 17 | .Prerequisites
|
17 | 18 |
|
18 | 19 | * 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. |
20 | 21 | * You have installed the OpenShift CLI (`oc`).
|
21 | 22 |
|
22 | 23 | .Procedure
|
|
44 | 45 | ----
|
45 | 46 | <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.
|
46 | 47 |
|
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. |
48 | 72 | +
|
49 | 73 | [NOTE]
|
50 | 74 | ====
|
|
0 commit comments