Skip to content

Commit

Permalink
Convert ValueTypeBytes attributes in logging exporter
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan <[email protected]>
  • Loading branch information
bogdandrutu committed Sep 27, 2022
1 parent 44ce8e3 commit 99c4eb0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions exporter/loggingexporter/internal/otlptext/databuffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package otlptext // import "go.opentelemetry.io/collector/exporter/loggingexport

import (
"bytes"
"encoding/base64"
"fmt"
"math"
"strconv"
Expand Down Expand Up @@ -280,6 +281,8 @@ func attributeValueToString(v pcommon.Value) string {
return strconv.FormatFloat(v.DoubleVal(), 'f', -1, 64)
case pcommon.ValueTypeInt:
return strconv.FormatInt(v.IntVal(), 10)
case pcommon.ValueTypeBytes:
return base64.StdEncoding.EncodeToString(v.BytesVal().AsRaw())
case pcommon.ValueTypeSlice:
return sliceToString(v.SliceVal())
case pcommon.ValueTypeMap:
Expand Down

0 comments on commit 99c4eb0

Please sign in to comment.