mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-05 17:27:51 +00:00
*: replace glog with klog
This commit is contained in:
parent
f69586b71c
commit
f18b6fd370
9 changed files with 49 additions and 49 deletions
|
|
@ -21,8 +21,8 @@ import (
|
|||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/golang/glog"
|
||||
pmodel "github.com/prometheus/common/model"
|
||||
"k8s.io/klog"
|
||||
|
||||
prom "github.com/directxman12/k8s-prometheus-adapter/pkg/client"
|
||||
"github.com/directxman12/k8s-prometheus-adapter/pkg/naming"
|
||||
|
|
@ -145,7 +145,7 @@ func (l *basicMetricLister) ListAllMetrics() (MetricUpdateResult, error) {
|
|||
newSeries[i] = namer.FilterSeries(series)
|
||||
}
|
||||
|
||||
glog.V(10).Infof("Set available metric list from Prometheus to: %v", newSeries)
|
||||
klog.V(10).Infof("Set available metric list from Prometheus to: %v", newSeries)
|
||||
|
||||
result.series = newSeries
|
||||
result.namers = l.namers
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ package provider
|
|||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/golang/glog"
|
||||
"github.com/kubernetes-incubator/custom-metrics-apiserver/pkg/provider"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/klog"
|
||||
|
||||
prom "github.com/directxman12/k8s-prometheus-adapter/pkg/client"
|
||||
"github.com/directxman12/k8s-prometheus-adapter/pkg/naming"
|
||||
|
|
@ -68,7 +68,7 @@ func (r *externalSeriesRegistry) filterAndStoreMetrics(result MetricUpdateResult
|
|||
namers := result.namers
|
||||
|
||||
if len(newSeriesSlices) != len(namers) {
|
||||
glog.Fatal("need one set of series per converter")
|
||||
klog.Fatal("need one set of series per converter")
|
||||
}
|
||||
apiMetricsCache := make([]provider.ExternalMetricInfo, 0)
|
||||
rawMetricsCache := make(map[string]seriesInfo)
|
||||
|
|
@ -79,7 +79,7 @@ func (r *externalSeriesRegistry) filterAndStoreMetrics(result MetricUpdateResult
|
|||
identity, err := namer.MetricNameForSeries(series)
|
||||
|
||||
if err != nil {
|
||||
glog.Errorf("unable to name series %q, skipping: %v", series.String(), err)
|
||||
klog.Errorf("unable to name series %q, skipping: %v", series.String(), err)
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
@ -119,7 +119,7 @@ func (r *externalSeriesRegistry) QueryForMetric(namespace string, metricName str
|
|||
info, found := r.metricsInfo[metricName]
|
||||
|
||||
if !found {
|
||||
glog.V(10).Infof("external metric %q not found", metricName)
|
||||
klog.V(10).Infof("external metric %q not found", metricName)
|
||||
return "", false, nil
|
||||
}
|
||||
query, err := info.namer.QueryForExternalSeries(info.seriesName, namespace, metricSelector)
|
||||
|
|
|
|||
|
|
@ -20,8 +20,8 @@ import (
|
|||
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
|
||||
"github.com/golang/glog"
|
||||
pmodel "github.com/prometheus/common/model"
|
||||
"k8s.io/klog"
|
||||
|
||||
"github.com/kubernetes-incubator/custom-metrics-apiserver/pkg/provider"
|
||||
|
||||
|
|
@ -44,7 +44,7 @@ func (p *externalPrometheusProvider) GetExternalMetric(namespace string, metricS
|
|||
selector, found, err := p.seriesRegistry.QueryForMetric(namespace, info.Metric, metricSelector)
|
||||
|
||||
if err != nil {
|
||||
glog.Errorf("unable to generate a query for the metric: %v", err)
|
||||
klog.Errorf("unable to generate a query for the metric: %v", err)
|
||||
return nil, apierr.NewInternalError(fmt.Errorf("unable to fetch metrics"))
|
||||
}
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ func (p *externalPrometheusProvider) GetExternalMetric(namespace string, metricS
|
|||
queryResults, err := p.promClient.Query(context.TODO(), pmodel.Now(), selector)
|
||||
|
||||
if err != nil {
|
||||
glog.Errorf("unable to fetch metrics from prometheus: %v", err)
|
||||
klog.Errorf("unable to fetch metrics from prometheus: %v", err)
|
||||
// don't leak implementation details to the user
|
||||
return nil, apierr.NewInternalError(fmt.Errorf("unable to fetch metrics"))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue