Skip to content

Commit

Permalink
chore: add otel pgx parameters to log
Browse files Browse the repository at this point in the history
  • Loading branch information
lzap authored and avitova committed Oct 12, 2023
1 parent 7b4e49d commit b84a0dc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/telemetry/zerolog_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"

"github.com/rs/zerolog"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/sdk/trace"
)
Expand Down Expand Up @@ -44,6 +45,9 @@ func (e *loggerExporter) ExportSpans(ctx context.Context, spans []trace.ReadOnly

for _, kv := range span.Attributes() {
key := string(kv.Key)
if kv.Value.Type() == attribute.STRINGSLICE {
t = t.Strs(key, kv.Value.AsStringSlice())
}
val := kv.Value.AsString()

if val == "" {
Expand Down

0 comments on commit b84a0dc

Please sign in to comment.