mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-26 14:46:35 +00:00
container: support hostprocess containers and expose kubernetes labels (#1911)
This commit is contained in:
@@ -30,7 +30,6 @@ import (
|
||||
"github.com/prometheus-community/windows_exporter/internal/pdh"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -208,9 +207,9 @@ windows_performancecounter_processor_information_processor_time\{core="0,0",stat
|
||||
promhttp.HandlerFor(registry, promhttp.HandlerOpts{ErrorHandling: promhttp.ContinueOnError}).ServeHTTP(rw, &http.Request{})
|
||||
got := rw.Body.String()
|
||||
|
||||
assert.NotEmpty(t, got)
|
||||
require.NotEmpty(t, got)
|
||||
require.NotEmpty(t, tc.expectedMetrics)
|
||||
assert.Regexp(t, tc.expectedMetrics, got)
|
||||
require.Regexp(t, tc.expectedMetrics, got)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ type Object struct {
|
||||
Type pdh.CounterType `json:"type" yaml:"type"`
|
||||
Instances []string `json:"instances" yaml:"instances"`
|
||||
Counters []Counter `json:"counters" yaml:"counters"`
|
||||
InstanceLabel string `json:"instance_label" yaml:"instance_label"` //nolint:tagliatelle
|
||||
InstanceLabel string `json:"instance_label" yaml:"instance_label"`
|
||||
|
||||
collector *pdh.Collector
|
||||
perfDataObject any
|
||||
|
||||
Reference in New Issue
Block a user