@@ -6,6 +6,15 @@ description: |-
6
6
TruncateLabel supports prepending a prefix to a label, while truncating them
7
7
to meet the maximum length constraints. Useful when grouping labels with a
8
8
kind of prefix. Both the prefix and the label will be truncated if necessary.
9
+ Uses a "balancing" algorithm between the prefix and the label, so that each
10
+ section is truncated as a factor of how much space it takes up in the merged
11
+ string.
12
+ -> The motivation for this is in working with monitoring systems such
13
+ as New Relic and Datadog where there are hundreds of applications in a
14
+ monitoring "prod" account, and also hundreds of applications in a monitoring
15
+ "nonprod" account. This allows us to group lists of monitors together using a
16
+ shared prefix, but also truncate them appropriately to fit length
17
+ constraints for names.
9
18
---
10
19
-->
11
20
@@ -15,6 +24,17 @@ TruncateLabel supports prepending a prefix to a label, while truncating them
15
24
to meet the maximum length constraints. Useful when grouping labels with a
16
25
kind of prefix. Both the prefix and the label will be truncated if necessary.
17
26
27
+ Uses a "balancing" algorithm between the prefix and the label, so that each
28
+ section is truncated as a factor of how much space it takes up in the merged
29
+ string.
30
+
31
+ -> The motivation for this is in working with monitoring systems such
32
+ as New Relic and Datadog where there are hundreds of applications in a
33
+ monitoring "prod" account, and also hundreds of applications in a monitoring
34
+ "nonprod" account. This allows us to group lists of monitors together using a
35
+ shared prefix, but also truncate them appropriately to fit length
36
+ constraints for names.
37
+
18
38
## Example Usage
19
39
20
40
``` terraform
0 commit comments