add network plugin metrics
Add network plugin metrics. The metrics are the same that were used in dockershim/kubelet until it was deprecated in kubernetes 1.23 https://github.com/kubernetes/kubernetes/blob/release-1.23/pkg/kubelet/dockershim/network/metrics/metrics.go Signed-off-by: Antonio Ojea <aojea@google.com>
This commit is contained in:
@@ -340,8 +340,12 @@ func (c *criService) setupPodNetwork(ctx context.Context, sandbox *sandboxstore.
|
||||
return fmt.Errorf("get cni namespace options: %w", err)
|
||||
}
|
||||
log.G(ctx).WithField("podsandboxid", id).Debugf("begin cni setup")
|
||||
netStart := time.Now()
|
||||
result, err := netPlugin.Setup(ctx, id, path, opts...)
|
||||
networkPluginOperations.WithValues(networkSetUpOp).Inc()
|
||||
networkPluginOperationsLatency.WithValues(networkSetUpOp).UpdateSince(netStart)
|
||||
if err != nil {
|
||||
networkPluginOperationsErrors.WithValues(networkSetUpOp).Inc()
|
||||
return err
|
||||
}
|
||||
logDebugCNIResult(ctx, id, result)
|
||||
|
||||
Reference in New Issue
Block a user