From cb063c2bf24a8bbb45f88164ea26fb027563d36b Mon Sep 17 00:00:00 2001 From: beorn7 Date: Tue, 18 Dec 2018 17:11:19 +0100 Subject: [PATCH 1/2] Update vendoring Signed-off-by: beorn7 --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 6ec1588..12321ef 100644 --- a/go.mod +++ b/go.mod @@ -5,8 +5,8 @@ require ( github.com/golang/protobuf v1.2.0 github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 - github.com/prometheus/common v0.0.0-20181126121408-4724e9255275 + github.com/prometheus/common v0.0.0-20181218105931-67670fe90761 github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a - golang.org/x/net v0.0.0-20181201002055-351d144fa1fc + golang.org/x/net v0.0.0-20181217023233-e147a9138326 golang.org/x/sync v0.0.0-20181108010431-42b317875d0f // indirect ) diff --git a/go.sum b/go.sum index 181c46d..223eaee 100644 --- a/go.sum +++ b/go.sum @@ -6,11 +6,11 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0j github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 h1:idejC8f05m9MGOsuEi1ATq9shN03HrxNkD/luQvxCv8= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/common v0.0.0-20181126121408-4724e9255275 h1:PnBWHBf+6L0jOqq0gIVUe6Yk0/QMZ640k6NvkxcBf+8= -github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.0.0-20181218105931-67670fe90761 h1:z6tvbDJ5OLJ48FFmnksv04a78maSTRBUIhkdHYV5Y98= +github.com/prometheus/common v0.0.0-20181218105931-67670fe90761/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a h1:9a8MnZMP0X2nLJdBg+pBmGgkJlSaKC2KaQmTCk1XDtE= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc h1:a3CU5tJYVj92DY2LaA1kUkrsqD5/3mLDhx2NcNqyW+0= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181217023233-e147a9138326 h1:iCzOf0xz39Tstp+Tu/WwyGjUXCk34QhQORRxBeXXTA4= +golang.org/x/net v0.0.0-20181217023233-e147a9138326/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= From 2c9811f88eb56c7eeb1e2262b10a17ef727cfc91 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Tue, 18 Dec 2018 17:20:25 +0100 Subject: [PATCH 2/2] Fix tests to adhere to the recent change in prometheus/common Signed-off-by: beorn7 --- prometheus/promhttp/http_test.go | 14 ++++---- prometheus/registry_test.go | 52 ++++++++++++++-------------- prometheus/testutil/testutil_test.go | 30 ++++++++-------- 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/prometheus/promhttp/http_test.go b/prometheus/promhttp/http_test.go index 6e23e6c..0738276 100644 --- a/prometheus/promhttp/http_test.go +++ b/prometheus/promhttp/http_test.go @@ -109,11 +109,11 @@ error collecting metric Desc{fqName: "invalid_metric", help: "not helpful", cons ` wantOKBody := `# HELP name docstring # TYPE name counter -name{constname="constvalue",labelname="val1"} 1 -name{constname="constvalue",labelname="val2"} 1 +name{constname="constvalue",labelname="val1"} 1.0 +name{constname="constvalue",labelname="val2"} 1.0 # HELP the_count Ah-ah-ah! Thunder and lightning! # TYPE the_count counter -the_count 0 +the_count 0.0 ` errorHandler.ServeHTTP(writer, request) @@ -163,11 +163,11 @@ func TestInstrumentMetricHandler(t *testing.T) { t.Errorf("got HTTP status code %d, want %d", got, want) } - want := "promhttp_metric_handler_requests_in_flight 1\n" + want := "promhttp_metric_handler_requests_in_flight 1.0\n" if got := writer.Body.String(); !strings.Contains(got, want) { t.Errorf("got body %q, does not contain %q", got, want) } - want = "promhttp_metric_handler_requests_total{code=\"200\"} 0\n" + want = "promhttp_metric_handler_requests_total{code=\"200\"} 0.0\n" if got := writer.Body.String(); !strings.Contains(got, want) { t.Errorf("got body %q, does not contain %q", got, want) } @@ -178,11 +178,11 @@ func TestInstrumentMetricHandler(t *testing.T) { t.Errorf("got HTTP status code %d, want %d", got, want) } - want = "promhttp_metric_handler_requests_in_flight 1\n" + want = "promhttp_metric_handler_requests_in_flight 1.0\n" if got := writer.Body.String(); !strings.Contains(got, want) { t.Errorf("got body %q, does not contain %q", got, want) } - want = "promhttp_metric_handler_requests_total{code=\"200\"} 1\n" + want = "promhttp_metric_handler_requests_total{code=\"200\"} 1.0\n" if got := writer.Body.String(); !strings.Contains(got, want) { t.Errorf("got body %q, does not contain %q", got, want) } diff --git a/prometheus/registry_test.go b/prometheus/registry_test.go index b9d9f13..6b6aaf3 100644 --- a/prometheus/registry_test.go +++ b/prometheus/registry_test.go @@ -99,7 +99,7 @@ func testHandler(t testing.TB) { externalMetricFamilyAsBytes := externalBuf.Bytes() externalMetricFamilyAsText := []byte(`# HELP externalname externaldocstring # TYPE externalname counter -externalname{externalconstname="externalconstvalue",externallabelname="externalval1"} 1 +externalname{externalconstname="externalconstvalue",externallabelname="externalval1"} 1.0 `) externalMetricFamilyAsProtoText := []byte(`name: "externalname" help: "externaldocstring" @@ -167,8 +167,8 @@ metric: < expectedMetricFamilyAsBytes := buf.Bytes() expectedMetricFamilyAsText := []byte(`# HELP name docstring # TYPE name counter -name{constname="constvalue",labelname="val1"} 1 -name{constname="constvalue",labelname="val2"} 1 +name{constname="constvalue",labelname="val1"} 1.0 +name{constname="constvalue",labelname="val2"} 1.0 `) expectedMetricFamilyAsProtoText := []byte(`name: "name" help: "docstring" @@ -267,8 +267,8 @@ collected metric "name" { label: label: