swarm: integrate OpenTracing; propagate ctx to internal APIs (#17169)

* swarm: propagate ctx, enable opentracing

* swarm/tracing: log error when tracing is misconfigured
This commit is contained in:
Anton Evangelatov
2018-07-13 17:40:28 +02:00
committed by Balint Gabor
parent f7d3678c28
commit 7c9314f231
170 changed files with 21762 additions and 249 deletions

View File

@@ -19,6 +19,7 @@
package pss
import (
"context"
"errors"
"time"
@@ -40,7 +41,7 @@ type Ping struct {
InC chan bool // optional, report back to calling code
}
func (p *Ping) pingHandler(msg interface{}) error {
func (p *Ping) pingHandler(ctx context.Context, msg interface{}) error {
var pingmsg *PingMsg
var ok bool
if pingmsg, ok = msg.(*PingMsg); !ok {
@@ -80,7 +81,7 @@ func NewPingProtocol(ping *Ping) *p2p.Protocol {
for {
select {
case ispong := <-ping.OutC:
pp.Send(&PingMsg{
pp.Send(context.TODO(), &PingMsg{
Created: time.Now(),
Pong: ispong,
})