func incrementCallsMetric(err error) {
	execExitError := &exec.ExitError{}
	execError := &exec.Error{}
	pathError := &fs.PathError{}
	switch {
	case err == nil:  
		metrics.ExecPluginCalls.Increment(successExitCode, noError)
	case errors.As(err, &execExitError):  
		metrics.ExecPluginCalls.Increment(execExitError.ExitCode(), pluginExecutionError)
	case errors.As(err, &execError), errors.As(err, &pathError):  
		metrics.ExecPluginCalls.Increment(failureExitCode, pluginNotFoundError)
	default:  
		klog.V(2).InfoS("unexpected exec plugin return error type", "type", reflect.TypeOf(err).String(), "err", err)
		metrics.ExecPluginCalls.Increment(failureExitCode, clientInternalError)
	}
}
incrementCallsMetric increments a global metrics counter for the number of calls to an exec
plugin, partitioned by exit code. The provided err should be the return value from
exec.Cmd.Run().
package exec
import (
	"errors"
	"io/fs"
	"os/exec"
	"reflect"
	"sync"
	"time"
	"k8s.io/klog/v2"
	"k8s.io/client-go/tools/metrics"
)
const (
	noError = "no_error"
	pluginExecutionError = "plugin_execution_error"
	pluginNotFoundError = "plugin_not_found_error"
	clientInternalError = "client_internal_error"
	successExitCode = 0
	failureExitCode = 1
)
type certificateExpirationTracker struct {
	mu        sync.RWMutex
	m         map[*Authenticator]time.Time
	metricSet func(*time.Time)
}
var expirationMetrics = &certificateExpirationTracker{
	m: map[*Authenticator]time.Time{},
	metricSet: func(e *time.Time) {
		metrics.ClientCertExpiry.Set(e)
	},
}
func (c *certificateExpirationTracker) set(a *Authenticator, t time.Time) {
	c.mu.Lock()
	defer c.mu.Unlock()
	c.m[a] = t
	earliest := time.Time{}
	for _, t := range c.m {
		if t.IsZero() {
			continue
		}
		if earliest.IsZero() || earliest.After(t) {
			earliest = t
		}
	}
	if earliest.IsZero() {
		c.metricSet(nil)
	} else {
		c.metricSet(&earliest)
	}
}