Catch this up to upstream/master.

This commit is contained in:
Tony Compton 2018-06-27 17:31:43 -04:00
parent 0af14dc93d
commit b3e1323a1c
11 changed files with 1442 additions and 520 deletions

View file

@ -33,40 +33,30 @@ import (
type externalPrometheusProvider struct {
mapper apimeta.RESTMapper
kubeClient dynamic.ClientPool
kubeClient dynamic.Interface
promClient prom.Client
SeriesRegistry
rateInterval time.Duration
}
func NewExternalPrometheusProvider(mapper apimeta.RESTMapper, kubeClient dynamic.ClientPool, promClient prom.Client, labelPrefix string, updateInterval time.Duration, rateInterval time.Duration, stopChan <-chan struct{}) provider.ExternalMetricsProvider {
func NewExternalPrometheusProvider(mapper apimeta.RESTMapper, kubeClient dynamic.Interface, promClient prom.Client, namers []MetricNamer, updateInterval time.Duration) (provider.ExternalMetricsProvider, Runnable) {
lister := &cachingMetricsLister{
updateInterval: updateInterval,
promClient: promClient,
namers: namers,
SeriesRegistry: &basicSeriesRegistry{
namer: metricNamer{
// TODO: populate the overrides list
overrides: nil,
mapper: mapper,
labelPrefix: labelPrefix,
},
mapper: mapper,
},
}
lister.RunUntil(stopChan)
return &externalPrometheusProvider{
mapper: mapper,
kubeClient: kubeClient,
promClient: promClient,
SeriesRegistry: lister,
rateInterval: rateInterval,
}
}, lister
}
func (p *externalPrometheusProvider) GetExternalMetric(namespace string, metricName string, metricSelector labels.Selector) (*external_metrics.ExternalMetricValueList, error) {