Skip to content

Commit e9e2ad6

Browse files
committed
docs(terraform): Updated the documentation.
1 parent d24133f commit e9e2ad6

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

corefunc/truncate_label.go

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ TruncateLabel supports prepending a prefix to a label, while truncating them
1010
to meet the maximum length constraints. Useful when grouping labels with a
1111
kind of prefix. Both the prefix and the label will be truncated if necessary.
1212
13+
Uses a "balancing" algorithm between the prefix and the label, so that each
14+
section is truncated as a factor of how much space it takes up in the merged
15+
string.
16+
1317
----
1418
1519
* maxLength (int64): The maximum allowed length of the combined label.

corefunc/truncate_label_data_source.go

+12-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,18 @@ func (d *truncateLabelDataSource) Schema(
7575
TruncateLabel supports prepending a prefix to a label, while truncating them
7676
to meet the maximum length constraints. Useful when grouping labels with a
7777
kind of prefix. Both the prefix and the label will be truncated if necessary.
78-
`)),
78+
79+
Uses a "balancing" algorithm between the prefix and the label, so that each
80+
section is truncated as a factor of how much space it takes up in the merged
81+
string.
82+
83+
-> The motivation for this is in working with monitoring systems such
84+
as New Relic and Datadog where there are hundreds of applications in a
85+
monitoring "prod" account, and also hundreds of applications in a monitoring
86+
"nonprod" account. This allows us to group lists of monitors together using a
87+
shared prefix, but also truncate them appropriately to fit length
88+
constraints for names.
89+
`)),
7990
Attributes: map[string]schema.Attribute{
8091
"id": schema.Int64Attribute{
8192
Description: "Not used. Required by the " +

docs/data-sources/truncate_label.md docs/data-sources/str_truncate_label.md

+20
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ description: |-
66
TruncateLabel supports prepending a prefix to a label, while truncating them
77
to meet the maximum length constraints. Useful when grouping labels with a
88
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.
918
---
1019
-->
1120

@@ -15,6 +24,17 @@ TruncateLabel supports prepending a prefix to a label, while truncating them
1524
to meet the maximum length constraints. Useful when grouping labels with a
1625
kind of prefix. Both the prefix and the label will be truncated if necessary.
1726

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+
1838
## Example Usage
1939

2040
```terraform

0 commit comments

Comments
 (0)