updated vendor
This commit is contained in:
+64
-14
@@ -80,11 +80,29 @@ type TransportCacheMetric interface {
|
||||
}
|
||||
|
||||
// TransportCreateCallsMetric counts the number of times a transport is created
|
||||
// partitioned by the result of the cache: hit, miss, uncacheable
|
||||
// partitioned by the result of the cache: hit, miss, miss-gc, uncacheable
|
||||
type TransportCreateCallsMetric interface {
|
||||
Increment(result string)
|
||||
}
|
||||
|
||||
// TransportCAReloadsMetric counts the number of times a CA reload is attempted,
|
||||
// partitioned by the result and reason.
|
||||
type TransportCAReloadsMetric interface {
|
||||
Increment(result, reason string)
|
||||
}
|
||||
|
||||
// TransportCertRotationGCCallsMetric counts the number of times a cert rotation
|
||||
// goroutine cancel func is called via GC cleanup.
|
||||
type TransportCertRotationGCCallsMetric interface {
|
||||
Increment()
|
||||
}
|
||||
|
||||
// TransportCacheGCCallsMetric counts the number of times a GC cleanup
|
||||
// attempts to delete a cache entry, partitioned by the result: deleted, skipped.
|
||||
type TransportCacheGCCallsMetric interface {
|
||||
Increment(result string)
|
||||
}
|
||||
|
||||
var (
|
||||
// ClientCertExpiry is the expiry time of a client certificate
|
||||
ClientCertExpiry ExpiryMetric = noopExpiry{}
|
||||
@@ -117,23 +135,34 @@ var (
|
||||
// TransportCreateCalls is the metric that counts the number of times a new transport
|
||||
// is created
|
||||
TransportCreateCalls TransportCreateCallsMetric = noopTransportCreateCalls{}
|
||||
// TransportCAReloads is the metric that counts the number of times a CA reload is attempted
|
||||
TransportCAReloads TransportCAReloadsMetric = noopTransportCAReloads{}
|
||||
// TransportCertRotationGCCalls counts the number of times a cert rotation goroutine
|
||||
// cancel func is called via GC cleanup
|
||||
TransportCertRotationGCCalls TransportCertRotationGCCallsMetric = noopTransportCertRotationGCCalls{}
|
||||
// TransportCacheGCCalls counts the number of times a GC cleanup attempts
|
||||
// to delete a transport cache entry, partitioned by result: deleted, skipped.
|
||||
TransportCacheGCCalls TransportCacheGCCallsMetric = noopTransportCacheGCCalls{}
|
||||
)
|
||||
|
||||
// RegisterOpts contains all the metrics to register. Metrics may be nil.
|
||||
type RegisterOpts struct {
|
||||
ClientCertExpiry ExpiryMetric
|
||||
ClientCertRotationAge DurationMetric
|
||||
RequestLatency LatencyMetric
|
||||
ResolverLatency ResolverLatencyMetric
|
||||
RequestSize SizeMetric
|
||||
ResponseSize SizeMetric
|
||||
RateLimiterLatency LatencyMetric
|
||||
RequestResult ResultMetric
|
||||
ExecPluginCalls CallsMetric
|
||||
ExecPluginPolicyCalls PolicyCallsMetric
|
||||
RequestRetry RetryMetric
|
||||
TransportCacheEntries TransportCacheMetric
|
||||
TransportCreateCalls TransportCreateCallsMetric
|
||||
ClientCertExpiry ExpiryMetric
|
||||
ClientCertRotationAge DurationMetric
|
||||
RequestLatency LatencyMetric
|
||||
ResolverLatency ResolverLatencyMetric
|
||||
RequestSize SizeMetric
|
||||
ResponseSize SizeMetric
|
||||
RateLimiterLatency LatencyMetric
|
||||
RequestResult ResultMetric
|
||||
ExecPluginCalls CallsMetric
|
||||
ExecPluginPolicyCalls PolicyCallsMetric
|
||||
RequestRetry RetryMetric
|
||||
TransportCacheEntries TransportCacheMetric
|
||||
TransportCreateCalls TransportCreateCallsMetric
|
||||
TransportCAReloads TransportCAReloadsMetric
|
||||
TransportCertRotationGCCalls TransportCertRotationGCCallsMetric
|
||||
TransportCacheGCCalls TransportCacheGCCallsMetric
|
||||
}
|
||||
|
||||
// Register registers metrics for the rest client to use. This can
|
||||
@@ -179,6 +208,15 @@ func Register(opts RegisterOpts) {
|
||||
if opts.TransportCreateCalls != nil {
|
||||
TransportCreateCalls = opts.TransportCreateCalls
|
||||
}
|
||||
if opts.TransportCAReloads != nil {
|
||||
TransportCAReloads = opts.TransportCAReloads
|
||||
}
|
||||
if opts.TransportCertRotationGCCalls != nil {
|
||||
TransportCertRotationGCCalls = opts.TransportCertRotationGCCalls
|
||||
}
|
||||
if opts.TransportCacheGCCalls != nil {
|
||||
TransportCacheGCCalls = opts.TransportCacheGCCalls
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -226,3 +264,15 @@ func (noopTransportCache) Observe(int) {}
|
||||
type noopTransportCreateCalls struct{}
|
||||
|
||||
func (noopTransportCreateCalls) Increment(string) {}
|
||||
|
||||
type noopTransportCAReloads struct{}
|
||||
|
||||
func (noopTransportCAReloads) Increment(result, reason string) {}
|
||||
|
||||
type noopTransportCertRotationGCCalls struct{}
|
||||
|
||||
func (noopTransportCertRotationGCCalls) Increment() {}
|
||||
|
||||
type noopTransportCacheGCCalls struct{}
|
||||
|
||||
func (noopTransportCacheGCCalls) Increment(string) {}
|
||||
|
||||
Reference in New Issue
Block a user