Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert ValueTypeBytes attributes in logging exporter #6153

Merged
merged 2 commits into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,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)

## 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.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