Skip to content

Commit

Permalink
fixed: report payload in span
Browse files Browse the repository at this point in the history
  • Loading branch information
primalmotion committed Aug 31, 2017
1 parent 2166d46 commit 3d21967
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions request.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

"github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/ext"
"github.com/opentracing/opentracing-go/log"

uuid "github.com/satori/go.uuid"
)
Expand Down Expand Up @@ -246,6 +247,10 @@ func (r *Request) StartTracing() {
r.span.SetTag("elemental.request.payload", string(r.Data))
r.span.SetTag("elemental.request.recursive", r.Recursive)
r.span.SetTag("elemental.request.client_ip", r.ClientIP)

if r.Data != nil {
r.span.LogFields(log.Object("payload", string(r.Data)))
}
}

// FinishTracing will finish the request tracing.
Expand Down

0 comments on commit 3d21967

Please sign in to comment.