Skip to content

Commit b33fcb3

Browse files
committed
Add Warnings
Signed-off-by: Mahad Zaryab <[email protected]>
1 parent 948e95e commit b33fcb3

File tree

1 file changed

+9
-0
lines changed
  • internal/storage/v2/clickhouse/tracestore/dbmodel

1 file changed

+9
-0
lines changed

internal/storage/v2/clickhouse/tracestore/dbmodel/to.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package dbmodel
55

66
import (
77
"encoding/base64"
8+
"fmt"
89

910
"go.opentelemetry.io/collector/pdata/pcommon"
1011
"go.opentelemetry.io/collector/pdata/ptrace"
@@ -119,6 +120,10 @@ func extractAttributes(attrs pcommon.Map) *Attributes {
119120
m := &xpdata.JSONMarshaler{}
120121
b, err := m.MarshalValue(v)
121122
if err != nil {
123+
out.StrKeys = append(out.StrKeys, jptrace.WarningsAttribute)
124+
out.StrValues = append(
125+
out.StrValues,
126+
fmt.Sprintf("failed to marshal slice attribute \"%s\": %v", k, err))
122127
break
123128
}
124129
out.ComplexKeys = append(out.ComplexKeys, key)
@@ -128,6 +133,10 @@ func extractAttributes(attrs pcommon.Map) *Attributes {
128133
m := &xpdata.JSONMarshaler{}
129134
b, err := m.MarshalValue(v)
130135
if err != nil {
136+
out.StrKeys = append(out.StrKeys, jptrace.WarningsAttribute)
137+
out.StrValues = append(
138+
out.StrValues,
139+
fmt.Sprintf("failed to marshal map attribute \"%s\": %v", k, err))
131140
break
132141
}
133142
out.ComplexKeys = append(out.ComplexKeys, key)

0 commit comments

Comments
 (0)