Skip to content

Commit b77e3d9

Browse files
aalexandlmolkova
andauthored
Clarify dictionary guidelines: duplicates and orphaned items (#732)
Co-authored-by: Liudmila Molkova <[email protected]>
1 parent 815b0e8 commit b77e3d9

File tree

2 files changed

+23
-5
lines changed

2 files changed

+23
-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: clarify dictionary guidelines: duplicates and other restrictions. [#732](https://github.com/open-telemetry/opentelemetry-proto/pull/732)
910
- profiles: drop field profile.comment_strindices. [#729](https://github.com/open-telemetry/opentelemetry-proto/pull/729)
1011
- profiles: clarify the original payload field comments. [#722](https://github.com/open-telemetry/opentelemetry-proto/pull/722)
1112
- profiles: add a note about cardinality implications for attribute values. [#713](https://github.com/open-telemetry/opentelemetry-proto/pull/713)

opentelemetry/proto/profiles/v1development/profiles.proto

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,29 @@ option go_package = "go.opentelemetry.io/proto/otlp/profiles/v1development";
9797
//
9898

9999
// ProfilesDictionary represents the profiles data shared across the
100-
// entire message being sent.
100+
// entire message being sent. The following applies to all fields in this
101+
// message:
102+
//
103+
// - A dictionary is an array of dictionary items. Users of the dictionary
104+
// compactly reference the items using the index within the array.
105+
//
106+
// - A dictionary MUST have a zero value encoded as the first element. This
107+
// allows for _index fields pointing into the dictionary to use a 0 pointer
108+
// value to indicate 'null' / 'not set'. Unless otherwise defined, a 'zero
109+
// value' message value is one with all default field values, so as to
110+
// minimize wire encoded size.
111+
//
112+
// - There SHOULD NOT be dupes in a dictionary. The identity of dictionary
113+
// items is based on their value, recursively as needed. If a particular
114+
// implementation does emit duplicated items, it MUST NOT attempt to give them
115+
// meaning based on the index or order. A profile processor may remove
116+
// duplicate items and this MUST NOT have any observable effects for
117+
// consumers.
118+
//
119+
// - There SHOULD NOT be orphaned (unreferenced) items in a dictionary. A
120+
// profile processor may remove ("garbage-collect") orphaned items and this
121+
// MUST NOT have any observable effects for consumers.
101122
//
102-
// Note that all fields in this message MUST have a zero value encoded as the first element.
103-
// This allows for _index fields pointing into the dictionary to use a 0 pointer value
104-
// to indicate 'null' / 'not set'. Unless otherwise defined, a 'zero value' message value
105-
// is one with all default field values, so as to minimize wire encoded size.
106123
message ProfilesDictionary {
107124
// Mappings from address ranges to the image/binary/library mapped
108125
// into that address range referenced by locations via Location.mapping_index.

0 commit comments

Comments
 (0)