@@ -131,16 +131,18 @@ func newICMPProxy(listenIP netip.Addr, zone string, logger *zerolog.Logger, idle
131131}
132132
133133func (ip * icmpProxy ) Request (ctx context.Context , pk * packet.ICMP , responder * packetResponder ) error {
134- _ , span := responder .requestSpan (ctx , pk )
134+ ctx , span := responder .requestSpan (ctx , pk )
135135 defer responder .exportSpan ()
136136
137137 originalEcho , err := getICMPEcho (pk .Message )
138138 if err != nil {
139139 tracing .EndWithErrorStatus (span , err )
140140 return err
141141 }
142- observeICMPRequest (ip .logger , span , pk .Src .String (), pk .Dst .String (), originalEcho .ID , originalEcho .Seq )
143-
142+ span .SetAttributes (
143+ attribute .Int ("originalEchoID" , originalEcho .ID ),
144+ attribute .Int ("seq" , originalEcho .Seq ),
145+ )
144146 echoIDTrackerKey := flow3Tuple {
145147 srcIP : pk .Src ,
146148 dstIP : pk .Dst ,
@@ -187,7 +189,6 @@ func (ip *icmpProxy) Request(ctx context.Context, pk *packet.ICMP, responder *pa
187189 tracing .EndWithErrorStatus (span , err )
188190 return err
189191 }
190-
191192 err = icmpFlow .sendToDst (pk .Dst , pk .Message )
192193 if err != nil {
193194 tracing .EndWithErrorStatus (span , err )
@@ -268,12 +269,15 @@ func (ip *icmpProxy) sendReply(ctx context.Context, reply *echoReply) error {
268269 _ , span := icmpFlow .responder .replySpan (ctx , ip .logger )
269270 defer icmpFlow .responder .exportSpan ()
270271
272+ span .SetAttributes (
273+ attribute .String ("dst" , reply .from .String ()),
274+ attribute .Int ("echoID" , reply .echo .ID ),
275+ attribute .Int ("seq" , reply .echo .Seq ),
276+ attribute .Int ("originalEchoID" , icmpFlow .originalEchoID ),
277+ )
271278 if err := icmpFlow .returnToSrc (reply ); err != nil {
272279 tracing .EndWithErrorStatus (span , err )
273- return err
274280 }
275- observeICMPReply (ip .logger , span , reply .from .String (), reply .echo .ID , reply .echo .Seq )
276- span .SetAttributes (attribute .Int ("originalEchoID" , icmpFlow .originalEchoID ))
277281 tracing .End (span )
278282 return nil
279283}
0 commit comments