Skip to content

Commit

Permalink
feat(otel): add more trace attributes
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Glimcher <[email protected]>
  • Loading branch information
glimchb committed Oct 11, 2023
1 parent 19e2c3c commit 68dd762
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion spdk/jsonrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,16 @@ func (r *Client) Call(ctx context.Context, method string, args, result interface
id := atomic.AddUint64(&r.id, 1)

_, childSpan := r.tracer.Start(ctx, "spdk."+method)
childSpan.SetAttributes(attribute.Int64("request.id", int64(id)))
defer childSpan.End()

if childSpan.IsRecording() {
childSpan.SetAttributes(
attribute.Int64("request.id", int64(id)),
attribute.String("spdk.socket", r.socket),
attribute.String("spdk.transport", r.transport),
)
}

request := RPCRequest{
RPCVersion: JSONRPCVersion,
ID: id,
Expand Down

0 comments on commit 68dd762

Please sign in to comment.