mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-26 19:35:10 +00:00
Merge pull request #75953 from wojtek-t/add_etcd_metrics
Expose etcd client latency metrics
This commit is contained in:
@@ -61,6 +61,9 @@ func scrapeMetrics(s *httptest.Server) ([]*prometheuspb.MetricFamily, error) {
|
||||
// Each line in the response body should contain all the data for a single metric.
|
||||
var metrics []*prometheuspb.MetricFamily
|
||||
scanner := bufio.NewScanner(resp.Body)
|
||||
// Increase buffer size, since default one is too small for reading
|
||||
// the /metrics contents.
|
||||
scanner.Buffer(make([]byte, 10), 131072)
|
||||
for scanner.Scan() {
|
||||
var metric prometheuspb.MetricFamily
|
||||
if err := proto.UnmarshalText(scanner.Text(), &metric); err != nil {
|
||||
@@ -122,5 +125,6 @@ func TestApiserverMetrics(t *testing.T) {
|
||||
checkForExpectedMetrics(t, metrics, []string{
|
||||
"apiserver_request_total",
|
||||
"apiserver_request_duration_seconds",
|
||||
"etcd_request_duration_seconds",
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user