diff --git a/CHANGELOG.md b/CHANGELOG.md index 17484e1b790..f058d197a28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ - Add AppendEmpty and EnsureCapacity method to primitive pdata slices (#6060) - Expose `AsRaw` and `FromRaw` `pcommon.Value` methods (#6090) +- Convert `ValueTypeBytes` attributes in logging exporter (#6153) - Updated how `telemetryInitializer` is created so it's instanced per Collector instance rather than global to the process (#6138) ## v0.60.0 Beta diff --git a/exporter/loggingexporter/internal/otlptext/databuffer.go b/exporter/loggingexporter/internal/otlptext/databuffer.go index 3138d7d0d2c..ac166e0949e 100644 --- a/exporter/loggingexporter/internal/otlptext/databuffer.go +++ b/exporter/loggingexporter/internal/otlptext/databuffer.go @@ -16,6 +16,7 @@ package otlptext // import "go.opentelemetry.io/collector/exporter/loggingexport import ( "bytes" + "encoding/base64" "fmt" "math" "strconv" @@ -280,6 +281,8 @@ func attributeValueToString(v pcommon.Value) string { return strconv.FormatFloat(v.Double(), 'f', -1, 64) case pcommon.ValueTypeInt: return strconv.FormatInt(v.Int(), 10) + case pcommon.ValueTypeBytes: + return base64.StdEncoding.EncodeToString(v.Bytes().AsRaw()) case pcommon.ValueTypeSlice: return sliceToString(v.Slice()) case pcommon.ValueTypeMap: