5 "github.com/pion/webrtc/v3"
6 "go.opentelemetry.io/otel"
7 "go.opentelemetry.io/otel/trace"
11 tracerName = "anacrolix.torrent.webtorrent"
12 webrtcConnTypeKey = "webtorrent.webrtc.conn.type"
15 func dataChannelStarted(peerConnectionCtx context.Context, dc *webrtc.DataChannel) (dataChannelCtx context.Context, span trace.Span) {
16 trace.SpanFromContext(peerConnectionCtx).AddEvent("starting data channel")
17 dataChannelCtx, span = otel.Tracer(tracerName).Start(peerConnectionCtx, "DataChannel")