Skip to content

Commit

Permalink
tweak code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeGoldsmith committed Feb 22, 2024
1 parent 92c8d7c commit 77f529a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions otlp/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const (
unknownLogSource = "unknown_log_source"

// maxDepth is the maximum depth of a nested kvlist attribute that will be flattened.
// If the depth is exceeded, the attribute should be added as a JSON string.
// If the depth is exceeded, the attribute should be added as a JSON string instead.
maxDepth = 5
)

Expand Down Expand Up @@ -261,7 +261,7 @@ func getValueFromMetadata(md metadata.MD, key string) string {
// AddAttributesToMap adds attributes to a map, extracting the underlying attribute data type.
// Supported types are string, bool, double, int, bytes, array, and kvlist.
// kvlist attributes are flattened to a depth of (maxDepth), if the depth is exceeded, the attribute is added as a JSON string.
// Bytes and array values are added as JSON strings.
// Bytes and array values are always added as JSON strings.
func AddAttributesToMap(attrs map[string]interface{}, attributes []*common.KeyValue) {
for _, attr := range attributes {
// ignore entries if the key is empty or value is nil
Expand Down Expand Up @@ -403,7 +403,7 @@ func getMarshallableValue(value *common.AnyValue) interface{} {
// addAttributeToMap adds an attribute to a map, extracting the underlying attribute data type.
// Supported types are string, bool, double, int, bytes, array, and kvlist.
// kvlist attributes are flattened to a depth of (maxDepth), if the depth is exceeded, the attribute is added as a JSON string.
// Bytes and array values are added as JSON strings.
// Bytes and array values are always added as JSON strings.
func addAttributeToMap(result map[string]interface{}, key string, value *common.AnyValue, depth int) {
switch value.Value.(type) {
case *common.AnyValue_StringValue:
Expand Down

0 comments on commit 77f529a

Please sign in to comment.