Skip to content

Commit 30fc161

Browse files
authored
Add a note about cardinality implications for attribute values. (#713)
1 parent 8e72d7a commit 30fc161

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ The full list of changes can be found in the compare view for the respective rel
66

77
### Changed
88

9+
- profiles: add a note about cardinality implications for attribute values. [#713](https://github.com/open-telemetry/opentelemetry-proto/pull/713)
910
- profiles: rename line -> lines and sample -> samples since they are repeated fields. [#712](https://github.com/open-telemetry/opentelemetry-proto/pull/712)
1011

1112
### Removed

opentelemetry/proto/profiles/v1development/profiles.proto

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,24 @@ message ProfilesDictionary {
130130
// string_table[0] must always be "" and present.
131131
repeated string string_table = 5;
132132

133-
// A common table for attributes referenced by various messages.
134-
// It is a collection of key/value pairs. Note, global attributes
135-
// like server name can be set using the resource API. Examples of attributes:
133+
// A common table for attributes referenced by the Profile, Sample, Mapping
134+
// and Location messages below through attribute_indices field. Each entry is
135+
// a key/value pair with an optional unit. Since this is a dictionary table,
136+
// multiple entries with the same key may be present, unlike direct attribute
137+
// tables like Resource.attributes. The referencing attribute_indices fields,
138+
// though, do maintain the key uniqueness requirement.
136139
//
140+
// It's recommended to use attributes for variables with bounded cardinality,
141+
// such as categorical variables
142+
// (https://en.wikipedia.org/wiki/Categorical_variable). Using an attribute of
143+
// a floating point type (e.g., CPU time) in a sample can quickly make every
144+
// attribute value unique, defeating the purpose of the dictionary and
145+
// impractically increasing the profile size.
146+
//
147+
// Examples of attributes:
137148
// "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
138-
// "/http/server_latency": 300
139149
// "abc.com/myattribute": true
140-
// "abc.com/score": 10.239
150+
// "allocation_size": 128 bytes
141151
//
142152
// The attribute values SHOULD NOT contain empty values.
143153
// The attribute values SHOULD NOT contain bytes values.

0 commit comments

Comments
 (0)