Yes, ping in the Ubuntu archive has the setuid bit set, which snapcraft correctly strips. You have a couple of options:
- adjust your snap to plugs ‘network-observe’ and use /bin/ping from the core snap
- adjust the ping in your snap to not require setuid. ping is currently setuid because it needs CAP_NET_RAW because it uses SOCK_RAW packets. Perhaps your program can invoke ping with different options.
I might mention that the kernel now supports the net.ipv4.ping_group_range sysctl which with a modern version of ping, the kernel will allow ping to use SOCK_DGRAM packets (without root, etc). This isn’t well integrated in Ubuntu or the core snap though. See https://bugs.launchpad.net/ubuntu/+source/iputils/+bug/1588917