add kubelet prometheus resource metrics endpoint

This commit is contained in:
David Ashpole
2019-03-07 15:39:37 -08:00
parent fec22bbb25
commit 6051664c0f
15 changed files with 743 additions and 14 deletions

View File

@@ -36,9 +36,8 @@ func NewKubeletMetrics() KubeletMetrics {
// GrabKubeletMetricsWithoutProxy retrieve metrics from the kubelet on the given node using a simple GET over http.
// Currently only used in integration tests.
func GrabKubeletMetricsWithoutProxy(nodeName string) (KubeletMetrics, error) {
metricsEndpoint := "http://%s/metrics"
resp, err := http.Get(fmt.Sprintf(metricsEndpoint, nodeName))
func GrabKubeletMetricsWithoutProxy(nodeName, path string) (KubeletMetrics, error) {
resp, err := http.Get(fmt.Sprintf("http://%s%s", nodeName, path))
if err != nil {
return KubeletMetrics{}, err
}