+ ctx, span := tracer.Start(
+ ctx,
+ "AnnounceHandler.Serve",
+ trace.WithAttributes(
+ attribute.Int64("announce.request.num_want", int64(req.NumWant)),
+ attribute.Int("announce.request.port", int(req.Port)),
+ attribute.String("announce.request.info_hash", hex.EncodeToString(req.InfoHash[:])),
+ attribute.String("announce.request.event", req.Event.String()),
+ attribute.Int64("announce.get_peers.opts.max_count_value", int64(opts.MaxCount.Value)),
+ attribute.Bool("announce.get_peers.opts.max_count_ok", opts.MaxCount.Ok),
+ attribute.String("announce.source.addr.ip", addr.Addr().String()),
+ attribute.Int("announce.source.addr.port", int(addr.Port())),
+ ),
+ )
+ defer span.End()
+ defer func() {
+ span.SetAttributes(attribute.Int("announce.get_peers.len", len(peers)))
+ }()
+