libp2p / go-libp2p-kad-dht

A Kademlia DHT implementation on go-libp2p
https://github.com/libp2p/specs/tree/master/kad-dht
MIT License
524 stars 224 forks source link

runLookupWithFollowup has a trace with invalid utf-8 attribute #858

Closed MichaelMure closed 1 year ago

MichaelMure commented 1 year ago

... and that make OpenTelemetry (in particular the GRCP exporter) unhappy:

traces export: rpc error: code = Internal desc = grpc: error while marshaling: string field contains invalid UTF-8

Tracking that down, I found that runLookupWithFollowup add a target attribute as string: https://github.com/libp2p/go-libp2p-kad-dht/blob/master/query.go#L84

However, that target is a DHT key (binary) cast here as a string. It's not valid utf-8.

A simple fix would be to b58 encode that value again.