diff --git a/expfmt/openmetrics_create.go b/expfmt/openmetrics_create.go index 6067e781..22a79b40 100644 --- a/expfmt/openmetrics_create.go +++ b/expfmt/openmetrics_create.go @@ -22,9 +22,10 @@ import ( "strconv" "strings" - "github.com/prometheus/common/model" "google.golang.org/protobuf/types/known/timestamppb" + "github.com/prometheus/common/model" + dto "github.com/prometheus/client_model/go" ) diff --git a/expfmt/openmetrics_create_test.go b/expfmt/openmetrics_create_test.go index 17b35c0a..a60b5557 100644 --- a/expfmt/openmetrics_create_test.go +++ b/expfmt/openmetrics_create_test.go @@ -32,7 +32,7 @@ func TestCreateOpenMetrics(t *testing.T) { t.Error(err) } - var scenarios = []struct { + scenarios := []struct { in *dto.MetricFamily options []EncoderOption out string @@ -543,7 +543,7 @@ foos_created 12345.6 Help: proto.String("Number of foos."), Type: dto.MetricType_COUNTER.Enum(), Metric: []*dto.Metric{ - &dto.Metric{ + { Counter: &dto.Counter{ Value: proto.Float64(42), CreatedTimestamp: openMetricsTimestamp,