Skip to content

Commit

Permalink
Convert ValueTypeBytes attributes in logging exporter (#6153)
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan <[email protected]>

Signed-off-by: Bogdan <[email protected]>
  • Loading branch information
bogdandrutu authored Sep 27, 2022
1 parent 8254e36 commit e981169
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
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.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:
Expand Down

0 comments on commit e981169

Please sign in to comment.