runtime: add more traces for network

Add traces for all the endpoinnt types
and the main interface functions.
Record errors for some traces.

Fixes: #1956

Signed-off-by: bin <bin@hyper.sh>
This commit is contained in:
bin
2021-06-02 17:53:30 +08:00
parent a57118d03a
commit 784025bb08
12 changed files with 158 additions and 28 deletions

View File

@@ -760,6 +760,9 @@ func (s *Sandbox) createNetwork(ctx context.Context) error {
NetNsCreated: s.config.NetworkConfig.NetNsCreated,
}
span.SetAttributes(otelLabel.Any("networkNS", s.networkNS))
span.SetAttributes(otelLabel.Any("NetworkConfig", s.config.NetworkConfig))
// In case there is a factory, network interfaces are hotplugged
// after vm is started.
if s.factory == nil {