From 868fe012f2dd25e58c1c81ad1371852fba54d26a Mon Sep 17 00:00:00 2001 From: Tao He Date: Sat, 2 Jul 2022 16:55:22 +0800 Subject: [PATCH] upgrade OTEL version to v1.7.0. --- .github/workflows/actions.yml | 2 + cmd/metrics-powerflex/main.go | 2 +- go.mod | 49 ++-- go.sum | 123 ++++++---- internal/entrypoint/run.go | 10 +- internal/k8s/mocks/kubernetes_api_mocks.go | 15 +- .../k8s/mocks/leader_elector_getter_mocks.go | 19 +- internal/k8s/mocks/node_getter_mocks.go | 15 +- .../k8s/mocks/storage_class_getter_mocks.go | 15 +- internal/k8s/mocks/volume_getter_mocks.go | 15 +- internal/service/metrics.go | 125 +++++----- internal/service/metrics_test.go | 223 +++++++++++------- .../mocks/instrument_provider_mocks.go | 96 ++++++++ .../service/mocks/leader_elector_mocks.go | 19 +- internal/service/mocks/metrics_mocks.go | 51 ++-- internal/service/mocks/node_finder_mocks.go | 15 +- .../service/mocks/powerflex_client_mocks.go | 27 ++- .../service/mocks/powerflex_system_mocks.go | 15 +- internal/service/mocks/sdc_finder_mocks.go | 15 +- internal/service/mocks/service_mocks.go | 35 +-- .../service/mocks/statistics_getter_mocks.go | 23 +- .../mocks/storage_class_finder_mocks.go | 15 +- .../storage_pool_statistics_getter_mocks.go | 15 +- internal/service/mocks/volume_finder_mocks.go | 15 +- .../mocks/volume_statistics_getter_mocks.go | 15 +- internal/service/service_test.go | 2 +- .../exporters/mocks/otlexporters_mocks.go | 23 +- .../opentelemetry_collector_exporter.go | 57 +++-- opentelemetry/exporters/types.go | 4 +- 29 files changed, 635 insertions(+), 420 deletions(-) create mode 100644 internal/service/mocks/instrument_provider_mocks.go diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 4e13f46..f869908 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -76,3 +76,5 @@ jobs: with: image-name: csm-metrics-powerflex severity-threshold: HIGH + env: + DOCKLE_HOST: "unix:///var/run/docker.sock" diff --git a/cmd/metrics-powerflex/main.go b/cmd/metrics-powerflex/main.go index ae12994..cf68ee1 100644 --- a/cmd/metrics-powerflex/main.go +++ b/cmd/metrics-powerflex/main.go @@ -23,7 +23,7 @@ import ( "github.com/sirupsen/logrus" sio "github.com/dell/goscaleio" - "go.opentelemetry.io/otel/api/global" + "go.opentelemetry.io/otel/metric/global" "os" diff --git a/go.mod b/go.mod index 5db9a49..3d99213 100644 --- a/go.mod +++ b/go.mod @@ -8,9 +8,12 @@ require ( github.com/golang/mock v1.6.0 github.com/sirupsen/logrus v1.8.1 github.com/spf13/viper v1.10.1 - github.com/stretchr/testify v1.7.0 - go.opentelemetry.io/otel v0.7.0 - go.opentelemetry.io/otel/exporters/otlp v0.7.0 + github.com/stretchr/testify v1.7.1 + go.opentelemetry.io/otel v1.7.0 + go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.30.0 + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.30.0 + go.opentelemetry.io/otel/metric v0.30.0 + go.opentelemetry.io/otel/sdk/metric v0.30.0 google.golang.org/grpc v1.46.0 k8s.io/api v0.23.3 k8s.io/apimachinery v0.23.3 @@ -19,48 +22,52 @@ require ( ) require ( - github.com/DataDog/sketches-go v0.0.0-20190923095040-43f19ad77ff7 // indirect + github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/evanphx/json-patch v4.12.0+incompatible // indirect - github.com/go-logr/logr v1.2.0 // indirect + github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/stdr v1.2.2 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.2 // indirect - github.com/google/go-cmp v0.5.6 // indirect - github.com/google/gofuzz v1.1.0 // indirect + github.com/google/go-cmp v0.5.7 // indirect + github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.3.0 // indirect github.com/googleapis/gnostic v0.5.5 // indirect - github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/magiconair/properties v1.8.5 // indirect github.com/mitchellh/mapstructure v1.4.3 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect - github.com/open-telemetry/opentelemetry-proto v0.4.0 // indirect github.com/pelletier/go-toml v1.9.4 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/spf13/afero v1.6.0 // indirect + github.com/spf13/afero v1.8.0 // indirect github.com/spf13/cast v1.4.1 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/subosito/gotenv v1.2.0 // indirect - golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect + go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.7.0 // indirect + go.opentelemetry.io/otel/sdk v1.7.0 // indirect + go.opentelemetry.io/otel/trace v1.7.0 // indirect + go.opentelemetry.io/proto/otlp v0.16.0 // indirect + golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8 // indirect - golang.org/x/sys v0.0.0-20211210111614-af8b64212486 // indirect - golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect + golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a // indirect + golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect - golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect + golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect - google.golang.org/protobuf v1.27.1 // indirect + google.golang.org/genproto v0.0.0-20220204002441-d6cc3cc0770e // indirect + google.golang.org/protobuf v1.28.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/ini.v1 v1.66.2 // indirect + gopkg.in/ini.v1 v1.66.3 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect - k8s.io/klog/v2 v2.30.0 // indirect - k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 // indirect - k8s.io/utils v0.0.0-20211116205334-6203023598ed // indirect - sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 // indirect + k8s.io/klog/v2 v2.40.1 // indirect + k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf // indirect + k8s.io/utils v0.0.0-20220127004650-9b3446523e65 // indirect + sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 // indirect sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect ) diff --git a/go.sum b/go.sum index 490ce64..d86c5e7 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,7 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= @@ -15,6 +16,7 @@ cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOY cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= @@ -35,6 +37,7 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= @@ -45,17 +48,16 @@ github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZ github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DataDog/sketches-go v0.0.0-20190923095040-43f19ad77ff7 h1:qELHH0AWCvf98Yf+CNIJx9vOZOfHFDDzgDRYsnNk/vs= -github.com/DataDog/sketches-go v0.0.0-20190923095040-43f19ad77ff7/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= -github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= +github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= +github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= +github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -68,6 +70,7 @@ github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnht github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= @@ -86,6 +89,7 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1/go.mod h1:KJwIaB5Mv44NWtYuAOFCVOjcI94vtpEz2JU/D2v6IjE= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= @@ -103,16 +107,21 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-logr/logr v1.2.0 h1:QK40JKJyMdUDz+h+xvCsru/bJhvG0UxvePV0ufL/AcE= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= +github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= +github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -160,11 +169,13 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -177,6 +188,7 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= @@ -188,12 +200,13 @@ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5m github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2cUuW7uA/OeU= github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw= github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= +github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/grpc-ecosystem/grpc-gateway v1.14.3/go.mod h1:6CwZWGDSPRJidgKAtJVvND6soZe6fT7iteq8wDPdhb0= -github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 h1:BZHcxBETFHIdVyhyEfOvn/RdU/QGdLI4y34qQGjGWO0= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -207,7 +220,6 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= @@ -246,16 +258,12 @@ github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGV github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/open-telemetry/opentelemetry-proto v0.4.0 h1:7EGs7QkdnR039zcQv71/wPLeeUUzqpH855VEWN4IHTE= -github.com/open-telemetry/opentelemetry-proto v0.4.0/go.mod h1:PMR5GI0F7BSpio+rBGFxNm6SLzg3FypDTcFuQZnO+F8= -github.com/opentracing/opentracing-go v1.1.1-0.20190913142402-a7454ce5950e/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -265,8 +273,8 @@ github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= -github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/afero v1.8.0 h1:5MmtuhAgYeU6qpa7w7bP0dv6MBYuup0vekhSpSkoq60= +github.com/spf13/afero v1.8.0/go.mod h1:CtAatgMJh6bJEIs48Ay/FOnkljP3WeGUG0MC1RfAqwo= github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= @@ -282,8 +290,9 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -298,19 +307,34 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= -go.opentelemetry.io/otel v0.7.0 h1:u43jukpwqR8EsyeJOMgrsUgZwVI1e1eVw7yuzRkD1l0= -go.opentelemetry.io/otel v0.7.0/go.mod h1:aZMyHG5TqDOXEgH2tyLiXSUKly1jT3yqE9PmrzIeCdo= -go.opentelemetry.io/otel/exporters/otlp v0.7.0 h1:uDxfCqueVUcjSvMfgBI7TCgoqwiEmDgKMoy1XYCHZGQ= -go.opentelemetry.io/otel/exporters/otlp v0.7.0/go.mod h1:Qxj/DhsAynmsutiEbuDpDtE9miR3q0NNMk3s0WJlqCc= +go.opentelemetry.io/otel v1.7.0 h1:Z2lA3Tdch0iDcrhJXDIlC94XE+bxok1F9B+4Lz/lGsM= +go.opentelemetry.io/otel v1.7.0/go.mod h1:5BdUoMIz5WEs0vt0CUEMtSSaTSHBBVwrhnz7+nrD5xk= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.7.0 h1:7Yxsak1q4XrJ5y7XBnNwqWx9amMZvoidCctv62XOQ6Y= +go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.7.0/go.mod h1:M1hVZHNxcbkAlcvrOMlpQ4YOO3Awf+4N2dxkZL3xm04= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.30.0 h1:Os0ds8fJp2AUa9DNraFWIycgUzevz47i6UvnSh+8LQ0= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric v0.30.0/go.mod h1:8Lz1GGcrx1kPGE3zqDrK7ZcPzABEfIQqBjq7roQa5ZA= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.30.0 h1:7E8znQuiqnaFDDl1zJYUpoqHteZI6u2rrcxH3Gwoiis= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.30.0/go.mod h1:RejW0QAFotPIixlFZKZka4/70S5UaFOqDO9DYOgScIs= +go.opentelemetry.io/otel/metric v0.30.0 h1:Hs8eQZ8aQgs0U49diZoaS6Uaxw3+bBE3lcMUKBFIk3c= +go.opentelemetry.io/otel/metric v0.30.0/go.mod h1:/ShZ7+TS4dHzDFmfi1kSXMhMVubNoP0oIaBp70J6UXU= +go.opentelemetry.io/otel/sdk v1.7.0 h1:4OmStpcKVOfvDOgCt7UriAPtKolwIhxpnSNI/yK+1B0= +go.opentelemetry.io/otel/sdk v1.7.0/go.mod h1:uTEOTwaqIVuTGiJN7ii13Ibp75wJmYUDe374q6cZwUU= +go.opentelemetry.io/otel/sdk/metric v0.30.0 h1:XTqQ4y3erR2Oj8xSAOL5ovO5011ch2ELg51z4fVkpME= +go.opentelemetry.io/otel/sdk/metric v0.30.0/go.mod h1:8AKFRi5HyvTR0RRty3paN1aMC9HMT+NzcEhw/BLkLX8= +go.opentelemetry.io/otel/trace v1.7.0 h1:O37Iogk1lEkMRXewVtZ1BBTVn5JEp8GrJvP92bJqC6o= +go.opentelemetry.io/otel/trace v1.7.0/go.mod h1:fzLSB9nqR2eXzxPXb2JW9IKE+ScyXA48yyE4TNvoHqU= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.opentelemetry.io/proto/otlp v0.16.0 h1:WHzDWdXUvbc5bG2ObdrGfaNpQz7ft7QN9HHmJlbiB1E= +go.opentelemetry.io/proto/otlp v0.16.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -359,7 +383,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191002035440-2ec189313ef0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -379,12 +402,14 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.0.0-20211209124913-491a49abca63 h1:iocB37TsdFuN6IBRZ+ry36wrkoV51/tl5vOWqkcPGvY= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -448,20 +473,23 @@ golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211210111614-af8b64212486 h1:5hpz5aRr+W1erYCL5JRhSUBJRph7l9XkNveoExlrKYk= -golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a h1:ppl5mZgokTT8uPkmYOyEUmPTr3ypaKkg5eFOGrAmxxE= +golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -475,10 +503,10 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac h1:7zkz7BUtwNFFqcowJ+RIgu2MaV/MapERkDIy+mwPyjs= golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 h1:GZokNIeuVkl3aZHJchRrr13WCsols02MLUcz1U9is6M= +golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -526,6 +554,7 @@ golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= @@ -571,8 +600,6 @@ google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= -google.golang.org/genproto v0.0.0-20191009194640-548a555dbc03/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= @@ -601,18 +628,20 @@ google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa h1:I0YcKz0I7OAhddo7ya8kMnvprhcWM045PmkBdMO9zN0= -google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220204002441-d6cc3cc0770e h1:hXl9hnyOkeznztYpYxVPAVZfPzcbO6Q0C+nLXodza8k= +google.golang.org/genproto v0.0.0-20220204002441-d6cc3cc0770e/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= @@ -629,6 +658,7 @@ google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.46.0 h1:oCjezcn6g6A75TGoKYBPgKmVBLexhYLM6MebdrPApP8= google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -643,8 +673,9 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -654,8 +685,8 @@ gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/ini.v1 v1.66.2 h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI= -gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.66.3 h1:jRskFVxYaMGAMUbN0UZ7niA9gzL9B49DOqE78vg0k3w= +gopkg.in/ini.v1 v1.66.3/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -686,18 +717,22 @@ k8s.io/client-go v0.23.3/go.mod h1:47oMd+YvAOqZM7pcQ6neJtBiFH7alOyfunYN48VsmwE= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.30.0 h1:bUO6drIvCIsvZ/XFgfxoGFQU/a4Qkh0iAlvUR7vlHJw= k8s.io/klog/v2 v2.30.0/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65 h1:E3J9oCLlaobFUqsjG9DfKbP2BmgwBL2p7pn0A3dG9W4= +k8s.io/klog/v2 v2.40.1 h1:P4RRucWk/lFOlDdkAr3mc7iWFkgKrZY9qZMAgek06S4= +k8s.io/klog/v2 v2.40.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20211115234752-e816edb12b65/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= +k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf h1:M9XBsiMslw2lb2ZzglC0TOkBPK5NQi0/noUrdnoFwUg= +k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf/go.mod h1:sX9MT8g7NVZM5lVL/j8QyCCJe8YSMW30QvGZWaCIDIk= k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20211116205334-6203023598ed h1:ck1fRPWPJWsMd8ZRFsWc6mh/zHp5fZ/shhbrgPUxDAE= k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20220127004650-9b3446523e65 h1:ONWS0Wgdg5wRiQIAui7L/023aC9+IxrIrydY7l8llsE= +k8s.io/utils v0.0.0-20220127004650-9b3446523e65/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= -sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6 h1:fD1pz4yfdADVNfFmcP2aBEtudwUQ1AlLnRBALr33v3s= sigs.k8s.io/json v0.0.0-20211020170558-c049b76a60c6/go.mod h1:p4QtZmO4uMYipTQNzagwnNoseA6OxSUutVw05NhYDRs= +sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2 h1:kDi4JBNAsJWfz1aEXhO8Jg87JJaPNLh5tIzYHgStQ9Y= +sigs.k8s.io/json v0.0.0-20211208200746-9f7c6b3444d2/go.mod h1:B+TnT182UBxE84DiCz4CVE26eOSDAeYCpfDnC2kdKMY= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.2.1 h1:bKCqE9GvQ5tiVHn5rfn1r+yao3aLQEaLzkkmAkf+A6Y= sigs.k8s.io/structured-merge-diff/v4 v4.2.1/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= diff --git a/internal/entrypoint/run.go b/internal/entrypoint/run.go index 08a006c..a03e8d7 100644 --- a/internal/entrypoint/run.go +++ b/internal/entrypoint/run.go @@ -19,7 +19,7 @@ import ( pflexServices "github.com/dell/karavi-metrics-powerflex/internal/service" otlexporters "github.com/dell/karavi-metrics-powerflex/opentelemetry/exporters" "github.com/sirupsen/logrus" - "go.opentelemetry.io/otel/exporters/otlp" + "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc" "google.golang.org/grpc/credentials" sio "github.com/dell/goscaleio" @@ -87,8 +87,8 @@ func Run(ctx context.Context, config *Config, exporter otlexporters.Otlexporter, }() go func() { - options := []otlp.ExporterOption{ - otlp.WithAddress(config.CollectorAddress), + options := []otlpmetricgrpc.Option{ + otlpmetricgrpc.WithEndpoint(config.CollectorAddress), } if config.CollectorCertPath != "" { @@ -96,9 +96,9 @@ func Run(ctx context.Context, config *Config, exporter otlexporters.Otlexporter, if err != nil { errCh <- err } - options = append(options, otlp.WithTLSCredentials(transportCreds)) + options = append(options, otlpmetricgrpc.WithTLSCredentials(transportCreds)) } else { - options = append(options, otlp.WithInsecure()) + options = append(options, otlpmetricgrpc.WithInsecure()) } errCh <- exporter.InitExporter(options...) diff --git a/internal/k8s/mocks/kubernetes_api_mocks.go b/internal/k8s/mocks/kubernetes_api_mocks.go index 5af2f1c..ceed696 100644 --- a/internal/k8s/mocks/kubernetes_api_mocks.go +++ b/internal/k8s/mocks/kubernetes_api_mocks.go @@ -5,35 +5,36 @@ package mocks import ( + reflect "reflect" + gomock "github.com/golang/mock/gomock" v1 "k8s.io/api/storage/v1" - reflect "reflect" ) -// MockKubernetesAPI is a mock of KubernetesAPI interface +// MockKubernetesAPI is a mock of KubernetesAPI interface. type MockKubernetesAPI struct { ctrl *gomock.Controller recorder *MockKubernetesAPIMockRecorder } -// MockKubernetesAPIMockRecorder is the mock recorder for MockKubernetesAPI +// MockKubernetesAPIMockRecorder is the mock recorder for MockKubernetesAPI. type MockKubernetesAPIMockRecorder struct { mock *MockKubernetesAPI } -// NewMockKubernetesAPI creates a new mock instance +// NewMockKubernetesAPI creates a new mock instance. func NewMockKubernetesAPI(ctrl *gomock.Controller) *MockKubernetesAPI { mock := &MockKubernetesAPI{ctrl: ctrl} mock.recorder = &MockKubernetesAPIMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockKubernetesAPI) EXPECT() *MockKubernetesAPIMockRecorder { return m.recorder } -// GetCSINodes mocks base method +// GetCSINodes mocks base method. func (m *MockKubernetesAPI) GetCSINodes() (*v1.CSINodeList, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetCSINodes") @@ -42,7 +43,7 @@ func (m *MockKubernetesAPI) GetCSINodes() (*v1.CSINodeList, error) { return ret0, ret1 } -// GetCSINodes indicates an expected call of GetCSINodes +// GetCSINodes indicates an expected call of GetCSINodes. func (mr *MockKubernetesAPIMockRecorder) GetCSINodes() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCSINodes", reflect.TypeOf((*MockKubernetesAPI)(nil).GetCSINodes)) diff --git a/internal/k8s/mocks/leader_elector_getter_mocks.go b/internal/k8s/mocks/leader_elector_getter_mocks.go index 5f88c96..dbfa5f0 100644 --- a/internal/k8s/mocks/leader_elector_getter_mocks.go +++ b/internal/k8s/mocks/leader_elector_getter_mocks.go @@ -5,34 +5,35 @@ package mocks import ( - gomock "github.com/golang/mock/gomock" reflect "reflect" + + gomock "github.com/golang/mock/gomock" ) -// MockLeaderElectorGetter is a mock of LeaderElectorGetter interface +// MockLeaderElectorGetter is a mock of LeaderElectorGetter interface. type MockLeaderElectorGetter struct { ctrl *gomock.Controller recorder *MockLeaderElectorGetterMockRecorder } -// MockLeaderElectorGetterMockRecorder is the mock recorder for MockLeaderElectorGetter +// MockLeaderElectorGetterMockRecorder is the mock recorder for MockLeaderElectorGetter. type MockLeaderElectorGetterMockRecorder struct { mock *MockLeaderElectorGetter } -// NewMockLeaderElectorGetter creates a new mock instance +// NewMockLeaderElectorGetter creates a new mock instance. func NewMockLeaderElectorGetter(ctrl *gomock.Controller) *MockLeaderElectorGetter { mock := &MockLeaderElectorGetter{ctrl: ctrl} mock.recorder = &MockLeaderElectorGetterMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockLeaderElectorGetter) EXPECT() *MockLeaderElectorGetterMockRecorder { return m.recorder } -// InitLeaderElection mocks base method +// InitLeaderElection mocks base method. func (m *MockLeaderElectorGetter) InitLeaderElection(arg0, arg1 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "InitLeaderElection", arg0, arg1) @@ -40,13 +41,13 @@ func (m *MockLeaderElectorGetter) InitLeaderElection(arg0, arg1 string) error { return ret0 } -// InitLeaderElection indicates an expected call of InitLeaderElection +// InitLeaderElection indicates an expected call of InitLeaderElection. func (mr *MockLeaderElectorGetterMockRecorder) InitLeaderElection(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitLeaderElection", reflect.TypeOf((*MockLeaderElectorGetter)(nil).InitLeaderElection), arg0, arg1) } -// IsLeader mocks base method +// IsLeader mocks base method. func (m *MockLeaderElectorGetter) IsLeader() bool { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IsLeader") @@ -54,7 +55,7 @@ func (m *MockLeaderElectorGetter) IsLeader() bool { return ret0 } -// IsLeader indicates an expected call of IsLeader +// IsLeader indicates an expected call of IsLeader. func (mr *MockLeaderElectorGetterMockRecorder) IsLeader() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsLeader", reflect.TypeOf((*MockLeaderElectorGetter)(nil).IsLeader)) diff --git a/internal/k8s/mocks/node_getter_mocks.go b/internal/k8s/mocks/node_getter_mocks.go index c6f8d66..20849ec 100644 --- a/internal/k8s/mocks/node_getter_mocks.go +++ b/internal/k8s/mocks/node_getter_mocks.go @@ -5,35 +5,36 @@ package mocks import ( + reflect "reflect" + gomock "github.com/golang/mock/gomock" v1 "k8s.io/api/core/v1" - reflect "reflect" ) -// MockNodeGetter is a mock of NodeGetter interface +// MockNodeGetter is a mock of NodeGetter interface. type MockNodeGetter struct { ctrl *gomock.Controller recorder *MockNodeGetterMockRecorder } -// MockNodeGetterMockRecorder is the mock recorder for MockNodeGetter +// MockNodeGetterMockRecorder is the mock recorder for MockNodeGetter. type MockNodeGetterMockRecorder struct { mock *MockNodeGetter } -// NewMockNodeGetter creates a new mock instance +// NewMockNodeGetter creates a new mock instance. func NewMockNodeGetter(ctrl *gomock.Controller) *MockNodeGetter { mock := &MockNodeGetter{ctrl: ctrl} mock.recorder = &MockNodeGetterMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockNodeGetter) EXPECT() *MockNodeGetterMockRecorder { return m.recorder } -// GetNodes mocks base method +// GetNodes mocks base method. func (m *MockNodeGetter) GetNodes() (*v1.NodeList, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetNodes") @@ -42,7 +43,7 @@ func (m *MockNodeGetter) GetNodes() (*v1.NodeList, error) { return ret0, ret1 } -// GetNodes indicates an expected call of GetNodes +// GetNodes indicates an expected call of GetNodes. func (mr *MockNodeGetterMockRecorder) GetNodes() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNodes", reflect.TypeOf((*MockNodeGetter)(nil).GetNodes)) diff --git a/internal/k8s/mocks/storage_class_getter_mocks.go b/internal/k8s/mocks/storage_class_getter_mocks.go index 9f0e463..3686501 100644 --- a/internal/k8s/mocks/storage_class_getter_mocks.go +++ b/internal/k8s/mocks/storage_class_getter_mocks.go @@ -5,35 +5,36 @@ package mocks import ( + reflect "reflect" + gomock "github.com/golang/mock/gomock" v1 "k8s.io/api/storage/v1" - reflect "reflect" ) -// MockStorageClassGetter is a mock of StorageClassGetter interface +// MockStorageClassGetter is a mock of StorageClassGetter interface. type MockStorageClassGetter struct { ctrl *gomock.Controller recorder *MockStorageClassGetterMockRecorder } -// MockStorageClassGetterMockRecorder is the mock recorder for MockStorageClassGetter +// MockStorageClassGetterMockRecorder is the mock recorder for MockStorageClassGetter. type MockStorageClassGetterMockRecorder struct { mock *MockStorageClassGetter } -// NewMockStorageClassGetter creates a new mock instance +// NewMockStorageClassGetter creates a new mock instance. func NewMockStorageClassGetter(ctrl *gomock.Controller) *MockStorageClassGetter { mock := &MockStorageClassGetter{ctrl: ctrl} mock.recorder = &MockStorageClassGetterMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockStorageClassGetter) EXPECT() *MockStorageClassGetterMockRecorder { return m.recorder } -// GetStorageClasses mocks base method +// GetStorageClasses mocks base method. func (m *MockStorageClassGetter) GetStorageClasses() (*v1.StorageClassList, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetStorageClasses") @@ -42,7 +43,7 @@ func (m *MockStorageClassGetter) GetStorageClasses() (*v1.StorageClassList, erro return ret0, ret1 } -// GetStorageClasses indicates an expected call of GetStorageClasses +// GetStorageClasses indicates an expected call of GetStorageClasses. func (mr *MockStorageClassGetterMockRecorder) GetStorageClasses() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageClasses", reflect.TypeOf((*MockStorageClassGetter)(nil).GetStorageClasses)) diff --git a/internal/k8s/mocks/volume_getter_mocks.go b/internal/k8s/mocks/volume_getter_mocks.go index 783539f..c2202c3 100644 --- a/internal/k8s/mocks/volume_getter_mocks.go +++ b/internal/k8s/mocks/volume_getter_mocks.go @@ -5,35 +5,36 @@ package mocks import ( + reflect "reflect" + gomock "github.com/golang/mock/gomock" v1 "k8s.io/api/core/v1" - reflect "reflect" ) -// MockVolumeGetter is a mock of VolumeGetter interface +// MockVolumeGetter is a mock of VolumeGetter interface. type MockVolumeGetter struct { ctrl *gomock.Controller recorder *MockVolumeGetterMockRecorder } -// MockVolumeGetterMockRecorder is the mock recorder for MockVolumeGetter +// MockVolumeGetterMockRecorder is the mock recorder for MockVolumeGetter. type MockVolumeGetterMockRecorder struct { mock *MockVolumeGetter } -// NewMockVolumeGetter creates a new mock instance +// NewMockVolumeGetter creates a new mock instance. func NewMockVolumeGetter(ctrl *gomock.Controller) *MockVolumeGetter { mock := &MockVolumeGetter{ctrl: ctrl} mock.recorder = &MockVolumeGetterMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockVolumeGetter) EXPECT() *MockVolumeGetterMockRecorder { return m.recorder } -// GetPersistentVolumes mocks base method +// GetPersistentVolumes mocks base method. func (m *MockVolumeGetter) GetPersistentVolumes() (*v1.PersistentVolumeList, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetPersistentVolumes") @@ -42,7 +43,7 @@ func (m *MockVolumeGetter) GetPersistentVolumes() (*v1.PersistentVolumeList, err return ret0, ret1 } -// GetPersistentVolumes indicates an expected call of GetPersistentVolumes +// GetPersistentVolumes indicates an expected call of GetPersistentVolumes. func (mr *MockVolumeGetterMockRecorder) GetPersistentVolumes() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPersistentVolumes", reflect.TypeOf((*MockVolumeGetter)(nil).GetPersistentVolumes)) diff --git a/internal/service/metrics.go b/internal/service/metrics.go index 46332d7..a720c92 100644 --- a/internal/service/metrics.go +++ b/internal/service/metrics.go @@ -13,8 +13,8 @@ import ( "errors" "sync" - "go.opentelemetry.io/otel/api/kv" - "go.opentelemetry.io/otel/api/metric" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric/instrument/asyncfloat64" ) // MetricsRecorder supports recording I/O metrics @@ -28,9 +28,10 @@ type MetricsRecorder interface { totalLogicalCapacity, logicalCapacityAvailable, logicalCapacityInUse, logicalProvisioned float64) error } -// Float64UpDownCounterCreater creates a Float64UpDownCounter metric +// Float64UpDownCounterCreater creates a Float64UpDownCounter InstrumentProvider +//go:generate mockgen -destination=mocks/instrument_provider_mocks.go -package=mocks go.opentelemetry.io/otel/metric/instrument/asyncfloat64 InstrumentProvider type Float64UpDownCounterCreater interface { - NewFloat64UpDownCounter(name string, options ...metric.InstrumentOption) (metric.Float64UpDownCounter, error) + AsyncFloat64() asyncfloat64.InstrumentProvider } // MetricsWrapper contains data used for pushing metrics data @@ -43,58 +44,52 @@ type MetricsWrapper struct { // Metrics contains the list of metrics data that is collected type Metrics struct { - ReadBW metric.BoundFloat64UpDownCounter - WriteBW metric.BoundFloat64UpDownCounter - ReadIOPS metric.BoundFloat64UpDownCounter - WriteIOPS metric.BoundFloat64UpDownCounter - ReadLatency metric.BoundFloat64UpDownCounter - WriteLatency metric.BoundFloat64UpDownCounter + ReadBW asyncfloat64.UpDownCounter + WriteBW asyncfloat64.UpDownCounter + ReadIOPS asyncfloat64.UpDownCounter + WriteIOPS asyncfloat64.UpDownCounter + ReadLatency asyncfloat64.UpDownCounter + WriteLatency asyncfloat64.UpDownCounter } // CapacityMetrics contains the metrics related to a capacity type CapacityMetrics struct { - TotalLogicalCapacity metric.BoundFloat64UpDownCounter - LogicalCapacityAvailable metric.BoundFloat64UpDownCounter - LogicalCapacityInUse metric.BoundFloat64UpDownCounter - LogicalProvisioned metric.BoundFloat64UpDownCounter + TotalLogicalCapacity asyncfloat64.UpDownCounter + LogicalCapacityAvailable asyncfloat64.UpDownCounter + LogicalCapacityInUse asyncfloat64.UpDownCounter + LogicalProvisioned asyncfloat64.UpDownCounter } -func (mw *MetricsWrapper) initMetrics(prefix, metaID string, labels []kv.KeyValue) (*Metrics, error) { - unboundReadBW, err := mw.Meter.NewFloat64UpDownCounter(prefix + "read_bw_megabytes_per_second") +func (mw *MetricsWrapper) initMetrics(prefix, metaID string, labels []attribute.KeyValue) (*Metrics, error) { + readBW, err := mw.Meter.AsyncFloat64().UpDownCounter(prefix + "read_bw_megabytes_per_second") if err != nil { return nil, err } - readBW := unboundReadBW.Bind(labels...) - unboundWriteBW, err := mw.Meter.NewFloat64UpDownCounter(prefix + "write_bw_megabytes_per_second") + writeBW, err := mw.Meter.AsyncFloat64().UpDownCounter(prefix + "write_bw_megabytes_per_second") if err != nil { return nil, err } - writeBW := unboundWriteBW.Bind(labels...) - unboundReadIOPS, err := mw.Meter.NewFloat64UpDownCounter(prefix + "read_iops_per_second") + readIOPS, err := mw.Meter.AsyncFloat64().UpDownCounter(prefix + "read_iops_per_second") if err != nil { return nil, err } - readIOPS := unboundReadIOPS.Bind(labels...) - unboundWriteIOPS, err := mw.Meter.NewFloat64UpDownCounter(prefix + "write_iops_per_second") + writeIOPS, err := mw.Meter.AsyncFloat64().UpDownCounter(prefix + "write_iops_per_second") if err != nil { return nil, err } - writeIOPS := unboundWriteIOPS.Bind(labels...) - unboundReadLatency, err := mw.Meter.NewFloat64UpDownCounter(prefix + "read_latency_milliseconds") + readLatency, err := mw.Meter.AsyncFloat64().UpDownCounter(prefix + "read_latency_milliseconds") if err != nil { return nil, err } - readLatency := unboundReadLatency.Bind(labels...) - unboundWriteLatency, err := mw.Meter.NewFloat64UpDownCounter(prefix + "write_latency_milliseconds") + writeLatency, err := mw.Meter.AsyncFloat64().UpDownCounter(prefix + "write_latency_milliseconds") if err != nil { return nil, err } - writeLatency := unboundWriteLatency.Bind(labels...) metrics := &Metrics{ ReadBW: readBW, @@ -111,30 +106,26 @@ func (mw *MetricsWrapper) initMetrics(prefix, metaID string, labels []kv.KeyValu return metrics, nil } -func (mw *MetricsWrapper) initCapacityMetrics(prefix, metaID string, labels []kv.KeyValue) (*CapacityMetrics, error) { - unboundTotalLogicalCapacity, err := mw.Meter.NewFloat64UpDownCounter(prefix + "total_logical_capacity_gigabytes") +func (mw *MetricsWrapper) initCapacityMetrics(prefix, metaID string, labels []attribute.KeyValue) (*CapacityMetrics, error) { + totalLogicalCapacity, err := mw.Meter.AsyncFloat64().UpDownCounter(prefix + "total_logical_capacity_gigabytes") if err != nil { return nil, err } - totalLogicalCapacity := unboundTotalLogicalCapacity.Bind(labels...) - unboundLogicalCapacityAvailable, err := mw.Meter.NewFloat64UpDownCounter(prefix + "logical_capacity_available_gigabytes") + logicalCapacityAvailable, err := mw.Meter.AsyncFloat64().UpDownCounter(prefix + "logical_capacity_available_gigabytes") if err != nil { return nil, err } - logicalCapacityAvailable := unboundLogicalCapacityAvailable.Bind(labels...) - unboundLogicalCapacityInUse, err := mw.Meter.NewFloat64UpDownCounter(prefix + "logical_capacity_in_use_gigabytes") + logicalCapacityInUse, err := mw.Meter.AsyncFloat64().UpDownCounter(prefix + "logical_capacity_in_use_gigabytes") if err != nil { return nil, err } - logicalCapacityInUse := unboundLogicalCapacityInUse.Bind(labels...) - unboundLogicalProvisioned, err := mw.Meter.NewFloat64UpDownCounter(prefix + "logical_provisioned_gigabytes") + logicalProvisioned, err := mw.Meter.AsyncFloat64().UpDownCounter(prefix + "logical_provisioned_gigabytes") if err != nil { return nil, err } - logicalProvisioned := unboundLogicalProvisioned.Bind(labels...) metrics := &CapacityMetrics{ TotalLogicalCapacity: totalLogicalCapacity, @@ -157,7 +148,7 @@ func (mw *MetricsWrapper) Record(ctx context.Context, meta interface{}, var prefix string var metaID string - var labels []kv.KeyValue + var labels []attribute.KeyValue switch v := meta.(type) { case *VolumeMeta: prefix, metaID = "powerflex_volume_", v.ID @@ -167,23 +158,23 @@ func (mw *MetricsWrapper) Record(ctx context.Context, meta interface{}, mappedSDCIDs += (ip.SdcID + "__") mappedSDCIPs += (ip.SdcIP + "__") } - labels = []kv.KeyValue{ - kv.String("VolumeID", v.ID), - kv.String("VolumeName", v.Name), - kv.String("StorageSystemID", v.StorageSystemID), - kv.String("PersistentVolumeName", v.PersistentVolumeName), - kv.String("MappedNodeIDs", mappedSDCIDs), - kv.String("MappedNodeIPs", mappedSDCIPs), - kv.String("PlotWithMean", "No"), + labels = []attribute.KeyValue{ + attribute.String("VolumeID", v.ID), + attribute.String("VolumeName", v.Name), + attribute.String("StorageSystemID", v.StorageSystemID), + attribute.String("PersistentVolumeName", v.PersistentVolumeName), + attribute.String("MappedNodeIDs", mappedSDCIDs), + attribute.String("MappedNodeIPs", mappedSDCIPs), + attribute.String("PlotWithMean", "No"), } case *SDCMeta: prefix, metaID = "powerflex_export_node_", v.ID - labels = []kv.KeyValue{ - kv.String("ID", v.ID), - kv.String("Name", v.Name), - kv.String("IP", v.IP), - kv.String("NodeGUID", v.SdcGUID), - kv.String("PlotWithMean", "No"), + labels = []attribute.KeyValue{ + attribute.String("ID", v.ID), + attribute.String("Name", v.Name), + attribute.String("IP", v.IP), + attribute.String("NodeGUID", v.SdcGUID), + attribute.String("PlotWithMean", "No"), } default: return errors.New("unknown MetaData type") @@ -206,7 +197,7 @@ func (mw *MetricsWrapper) Record(ctx context.Context, meta interface{}, } metricsMapValue = newMetrics } else { - currentLabels := currentLabels.([]kv.KeyValue) + currentLabels := currentLabels.([]attribute.KeyValue) updatedLabels := currentLabels haveLabelsChanged := false for i, current := range currentLabels { @@ -231,12 +222,12 @@ func (mw *MetricsWrapper) Record(ctx context.Context, meta interface{}, metrics := metricsMapValue.(*Metrics) - metrics.ReadBW.Add(ctx, readBW) - metrics.WriteBW.Add(ctx, writeBW) - metrics.ReadIOPS.Add(ctx, readIOPS) - metrics.WriteIOPS.Add(ctx, writeIOPS) - metrics.ReadLatency.Add(ctx, readLatency) - metrics.WriteLatency.Add(ctx, writeLatency) + metrics.ReadBW.Observe(ctx, readBW, labels...) + metrics.WriteBW.Observe(ctx, writeBW, labels...) + metrics.ReadIOPS.Observe(ctx, readIOPS, labels...) + metrics.WriteIOPS.Observe(ctx, writeIOPS, labels...) + metrics.ReadLatency.Observe(ctx, readLatency, labels...) + metrics.WriteLatency.Observe(ctx, writeLatency, labels...) return nil } @@ -251,11 +242,11 @@ func (mw *MetricsWrapper) RecordCapacity(ctx context.Context, meta interface{}, case "csi-vxflexos.dellemc.com": prefix, metaID := "powerflex_storage_pool_", v.ID for pool := range v.StoragePools { - labels := []kv.KeyValue{ - kv.String("StorageClass", v.Name), - kv.String("Driver", v.Driver), - kv.String("StoragePool", pool), - kv.String("StorageSystemID", v.StorageSystemID), + labels := []attribute.KeyValue{ + attribute.String("StorageClass", v.Name), + attribute.String("Driver", v.Driver), + attribute.String("StoragePool", pool), + attribute.String("StorageSystemID", v.StorageSystemID), } metricsMapValue, ok := mw.CapacityMetrics.Load(metaID) @@ -269,10 +260,10 @@ func (mw *MetricsWrapper) RecordCapacity(ctx context.Context, meta interface{}, metrics := metricsMapValue.(*CapacityMetrics) - metrics.TotalLogicalCapacity.Add(ctx, totalLogicalCapacity) - metrics.LogicalCapacityAvailable.Add(ctx, logicalCapacityAvailable) - metrics.LogicalCapacityInUse.Add(ctx, logicalCapacityInUse) - metrics.LogicalProvisioned.Add(ctx, logicalProvisioned) + metrics.TotalLogicalCapacity.Observe(ctx, totalLogicalCapacity, labels...) + metrics.LogicalCapacityAvailable.Observe(ctx, logicalCapacityAvailable, labels...) + metrics.LogicalCapacityInUse.Observe(ctx, logicalCapacityInUse, labels...) + metrics.LogicalProvisioned.Observe(ctx, logicalProvisioned, labels...) } } default: diff --git a/internal/service/metrics_test.go b/internal/service/metrics_test.go index e17e038..23c87c4 100644 --- a/internal/service/metrics_test.go +++ b/internal/service/metrics_test.go @@ -15,11 +15,9 @@ import ( "github.com/dell/karavi-metrics-powerflex/internal/service" "github.com/dell/karavi-metrics-powerflex/internal/service/mocks" - "github.com/golang/mock/gomock" - "go.opentelemetry.io/otel/api/global" - "go.opentelemetry.io/otel/api/kv" - "go.opentelemetry.io/otel/api/metric" + "go.opentelemetry.io/otel/attribute" + "go.opentelemetry.io/otel/metric/global" ) func Test_Metrics_Record(t *testing.T) { @@ -63,43 +61,45 @@ func Test_Metrics_Record(t *testing.T) { getMeter := func(prefix string) *service.MetricsWrapper { meter := mocks.NewMockFloat64UpDownCounterCreater(ctrl) + provider := mocks.NewMockInstrumentProvider(ctrl) otMeter := global.Meter(prefix + "_test") - readBW, err := otMeter.NewFloat64UpDownCounter(prefix + "read_bw_megabytes_per_second") + readBW, err := otMeter.AsyncFloat64().UpDownCounter(prefix + "read_bw_megabytes_per_second") if err != nil { t.Fatal(err) } - writeBW, err := otMeter.NewFloat64UpDownCounter(prefix + "write_bw_megabytes_per_second") + writeBW, err := otMeter.AsyncFloat64().UpDownCounter(prefix + "write_bw_megabytes_per_second") if err != nil { t.Fatal(err) } - readIOPS, err := otMeter.NewFloat64UpDownCounter(prefix + "read_iops_per_second") + readIOPS, err := otMeter.AsyncFloat64().UpDownCounter(prefix + "read_iops_per_second") if err != nil { t.Fatal(err) } - writeIOPS, err := otMeter.NewFloat64UpDownCounter(prefix + "write_iops_per_second") + writeIOPS, err := otMeter.AsyncFloat64().UpDownCounter(prefix + "write_iops_per_second") if err != nil { t.Fatal(err) } - readLatency, err := otMeter.NewFloat64UpDownCounter(prefix + "read_latency_milliseconds") + readLatency, err := otMeter.AsyncFloat64().UpDownCounter(prefix + "read_latency_milliseconds") if err != nil { t.Fatal(err) } - writeLatency, err := otMeter.NewFloat64UpDownCounter(prefix + "write_latency_milliseconds") + writeLatency, err := otMeter.AsyncFloat64().UpDownCounter(prefix + "write_latency_milliseconds") if err != nil { t.Fatal(err) } - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(readBW, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(writeBW, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(readIOPS, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(writeIOPS, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(readLatency, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(writeLatency, nil) + meter.EXPECT().AsyncFloat64().Return(provider).Times(6) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(readBW, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(writeBW, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(readIOPS, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(writeIOPS, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(readLatency, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(writeLatency, nil) return &service.MetricsWrapper{ Meter: meter, @@ -116,8 +116,15 @@ func Test_Metrics_Record(t *testing.T) { "error creating read_bw_megabytes_per_second": func(t *testing.T) ([]*service.MetricsWrapper, []checkFn) { ctrl := gomock.NewController(t) meter := mocks.NewMockFloat64UpDownCounterCreater(ctrl) + provider := mocks.NewMockInstrumentProvider(ctrl) + otMeter := global.Meter("") + empty, err := otMeter.AsyncFloat64().UpDownCounter("") + if err != nil { + t.Fatal(err) + } - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(metric.Float64UpDownCounter{}, errors.New("error")).Times(2) + meter.EXPECT().AsyncFloat64().Return(provider).Times(2) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(empty, errors.New("error")).Times(2) mws := []*service.MetricsWrapper{{Meter: meter}, {Meter: meter}} @@ -127,13 +134,19 @@ func Test_Metrics_Record(t *testing.T) { ctrl := gomock.NewController(t) getMeter := func(prefix string) *service.MetricsWrapper { meter := mocks.NewMockFloat64UpDownCounterCreater(ctrl) + provider := mocks.NewMockInstrumentProvider(ctrl) otMeter := global.Meter(prefix + "_test") - readBW, err := otMeter.NewFloat64UpDownCounter(prefix + "read_bw_megabytes_per_second") + readBW, err := otMeter.AsyncFloat64().UpDownCounter(prefix + "read_bw_megabytes_per_second") + if err != nil { + t.Fatal(err) + } + empty, err := otMeter.AsyncFloat64().UpDownCounter("") if err != nil { t.Fatal(err) } - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(readBW, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(metric.Float64UpDownCounter{}, errors.New("error")) + meter.EXPECT().AsyncFloat64().Return(provider).Times(2) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(readBW, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(empty, errors.New("error")) return &service.MetricsWrapper{ Meter: meter, @@ -151,21 +164,28 @@ func Test_Metrics_Record(t *testing.T) { ctrl := gomock.NewController(t) getMeter := func(prefix string) *service.MetricsWrapper { meter := mocks.NewMockFloat64UpDownCounterCreater(ctrl) + provider := mocks.NewMockInstrumentProvider(ctrl) otMeter := global.Meter(prefix + "_test") - readBW, err := otMeter.NewFloat64UpDownCounter(prefix + "read_bw_megabytes_per_second") + readBW, err := otMeter.AsyncFloat64().UpDownCounter(prefix + "read_bw_megabytes_per_second") if err != nil { t.Fatal(err) } - writeBW, err := otMeter.NewFloat64UpDownCounter(prefix + "write_bw_megabytes_per_second") + writeBW, err := otMeter.AsyncFloat64().UpDownCounter(prefix + "write_bw_megabytes_per_second") if err != nil { t.Fatal(err) } - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(readBW, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(writeBW, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(metric.Float64UpDownCounter{}, errors.New("error")) + empty, err := otMeter.AsyncFloat64().UpDownCounter("") + if err != nil { + t.Fatal(err) + } + + meter.EXPECT().AsyncFloat64().Return(provider).Times(3) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(readBW, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(writeBW, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(empty, errors.New("error")) return &service.MetricsWrapper{ Meter: meter, @@ -183,27 +203,34 @@ func Test_Metrics_Record(t *testing.T) { ctrl := gomock.NewController(t) getMeter := func(prefix string) *service.MetricsWrapper { meter := mocks.NewMockFloat64UpDownCounterCreater(ctrl) + provider := mocks.NewMockInstrumentProvider(ctrl) otMeter := global.Meter(prefix + "_test") - readBW, err := otMeter.NewFloat64UpDownCounter(prefix + "read_bw_megabytes_per_second") + readBW, err := otMeter.AsyncFloat64().UpDownCounter(prefix + "read_bw_megabytes_per_second") if err != nil { t.Fatal(err) } - writeBW, err := otMeter.NewFloat64UpDownCounter(prefix + "write_bw_megabytes_per_second") + writeBW, err := otMeter.AsyncFloat64().UpDownCounter(prefix + "write_bw_megabytes_per_second") if err != nil { t.Fatal(err) } - readIOPS, err := otMeter.NewFloat64UpDownCounter(prefix + "read_iops_per_second") + readIOPS, err := otMeter.AsyncFloat64().UpDownCounter(prefix + "read_iops_per_second") if err != nil { t.Fatal(err) } - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(readBW, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(writeBW, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(readIOPS, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(metric.Float64UpDownCounter{}, errors.New("error")) + empty, err := otMeter.AsyncFloat64().UpDownCounter("") + if err != nil { + t.Fatal(err) + } + + meter.EXPECT().AsyncFloat64().Return(provider).Times(4) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(readBW, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(writeBW, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(readIOPS, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(empty, errors.New("error")) return &service.MetricsWrapper{ Meter: meter, @@ -221,33 +248,39 @@ func Test_Metrics_Record(t *testing.T) { ctrl := gomock.NewController(t) getMeter := func(prefix string) *service.MetricsWrapper { meter := mocks.NewMockFloat64UpDownCounterCreater(ctrl) + provider := mocks.NewMockInstrumentProvider(ctrl) otMeter := global.Meter(prefix + "_test") - readBW, err := otMeter.NewFloat64UpDownCounter(prefix + "read_bw_megabytes_per_second") + readBW, err := otMeter.AsyncFloat64().UpDownCounter(prefix + "read_bw_megabytes_per_second") if err != nil { t.Fatal(err) } - writeBW, err := otMeter.NewFloat64UpDownCounter(prefix + "write_bw_megabytes_per_second") + writeBW, err := otMeter.AsyncFloat64().UpDownCounter(prefix + "write_bw_megabytes_per_second") if err != nil { t.Fatal(err) } - readIOPS, err := otMeter.NewFloat64UpDownCounter(prefix + "read_iops_per_second") + readIOPS, err := otMeter.AsyncFloat64().UpDownCounter(prefix + "read_iops_per_second") if err != nil { t.Fatal(err) } - writeIOPS, err := otMeter.NewFloat64UpDownCounter(prefix + "write_iops_per_second") + writeIOPS, err := otMeter.AsyncFloat64().UpDownCounter(prefix + "write_iops_per_second") if err != nil { t.Fatal(err) } - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(readBW, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(writeBW, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(readIOPS, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(writeIOPS, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(metric.Float64UpDownCounter{}, errors.New("error")) + empty, err := otMeter.AsyncFloat64().UpDownCounter("") + if err != nil { + t.Fatal(err) + } + meter.EXPECT().AsyncFloat64().Return(provider).Times(5) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(readBW, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(writeBW, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(readIOPS, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(writeIOPS, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(empty, errors.New("error")) return &service.MetricsWrapper{ Meter: meter, @@ -265,39 +298,46 @@ func Test_Metrics_Record(t *testing.T) { ctrl := gomock.NewController(t) getMeter := func(prefix string) *service.MetricsWrapper { meter := mocks.NewMockFloat64UpDownCounterCreater(ctrl) + provider := mocks.NewMockInstrumentProvider(ctrl) otMeter := global.Meter(prefix + "_test") - readBW, err := otMeter.NewFloat64UpDownCounter(prefix + "read_bw_megabytes_per_second") + readBW, err := otMeter.AsyncFloat64().UpDownCounter(prefix + "read_bw_megabytes_per_second") + if err != nil { + t.Fatal(err) + } + + writeBW, err := otMeter.AsyncFloat64().UpDownCounter(prefix + "write_bw_megabytes_per_second") if err != nil { t.Fatal(err) } - writeBW, err := otMeter.NewFloat64UpDownCounter(prefix + "write_bw_megabytes_per_second") + readIOPS, err := otMeter.AsyncFloat64().UpDownCounter(prefix + "read_iops_per_second") if err != nil { t.Fatal(err) } - readIOPS, err := otMeter.NewFloat64UpDownCounter(prefix + "read_iops_per_second") + writeIOPS, err := otMeter.AsyncFloat64().UpDownCounter(prefix + "write_iops_per_second") if err != nil { t.Fatal(err) } - writeIOPS, err := otMeter.NewFloat64UpDownCounter(prefix + "write_iops_per_second") + readLatency, err := otMeter.AsyncFloat64().UpDownCounter(prefix + "read_latency_milliseconds") if err != nil { t.Fatal(err) } - readLatency, err := otMeter.NewFloat64UpDownCounter(prefix + "read_latency_milliseconds") + empty, err := otMeter.AsyncFloat64().UpDownCounter("") if err != nil { t.Fatal(err) } - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(readBW, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(writeBW, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(readIOPS, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(writeIOPS, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(readLatency, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(metric.Float64UpDownCounter{}, errors.New("error")) + meter.EXPECT().AsyncFloat64().Return(provider).Times(6) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(readBW, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(writeBW, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(readIOPS, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(writeIOPS, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(readLatency, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(empty, errors.New("error")) return &service.MetricsWrapper{ Meter: meter, @@ -347,32 +387,34 @@ func Test_Metrics_RecordCapacity(t *testing.T) { ctrl := gomock.NewController(t) meter := mocks.NewMockFloat64UpDownCounterCreater(ctrl) + provider := mocks.NewMockInstrumentProvider(ctrl) otMeter := global.Meter("test") - totalLogicalCapacity, err := otMeter.NewFloat64UpDownCounter("TotalLogicalCapacity") + totalLogicalCapacity, err := otMeter.AsyncFloat64().UpDownCounter("TotalLogicalCapacity") if err != nil { t.Fatal(err) } - logicalCapacityAvailable, err := otMeter.NewFloat64UpDownCounter("LogicalCapacityAvailable") + logicalCapacityAvailable, err := otMeter.AsyncFloat64().UpDownCounter("LogicalCapacityAvailable") if err != nil { t.Fatal(err) } - logicalCapacityInUse, err := otMeter.NewFloat64UpDownCounter("LogicalCapacityInUse") + logicalCapacityInUse, err := otMeter.AsyncFloat64().UpDownCounter("LogicalCapacityInUse") if err != nil { t.Fatal(err) } - logicalProvisioned, err := otMeter.NewFloat64UpDownCounter("LogicalProvisioned") + logicalProvisioned, err := otMeter.AsyncFloat64().UpDownCounter("LogicalProvisioned") if err != nil { t.Fatal(err) } - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(totalLogicalCapacity, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(logicalCapacityAvailable, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(logicalCapacityInUse, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(logicalProvisioned, nil) + meter.EXPECT().AsyncFloat64().Return(provider).Times(4) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(totalLogicalCapacity, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(logicalCapacityAvailable, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(logicalCapacityInUse, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(logicalProvisioned, nil) mw := &service.MetricsWrapper{ Meter: meter, @@ -392,8 +434,15 @@ func Test_Metrics_RecordCapacity(t *testing.T) { "error creating CapacityInUse": func(t *testing.T) (*service.MetricsWrapper, service.StorageClassMeta, []checkFn) { ctrl := gomock.NewController(t) meter := mocks.NewMockFloat64UpDownCounterCreater(ctrl) + provider := mocks.NewMockInstrumentProvider(ctrl) + otMeter := global.Meter("") + empty, err := otMeter.AsyncFloat64().UpDownCounter("") + if err != nil { + t.Fatal(err) + } - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(metric.Float64UpDownCounter{}, errors.New("error")).Times(1) + meter.EXPECT().AsyncFloat64().Return(provider).Times(1) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(empty, errors.New("error")).Times(1) mw := &service.MetricsWrapper{ Meter: meter, @@ -446,60 +495,62 @@ func Test_Volume_Metrics_Label_Update(t *testing.T) { }, } - expectedLables := []kv.KeyValue{ - kv.String("VolumeID", metaSecond.ID), - kv.String("VolumeName", metaSecond.Name), - kv.String("MappedNodeIDs", "__"+metaSecond.MappedSDCs[0].SdcID+"__"), - kv.String("MappedNodeIPs", "__"+metaSecond.MappedSDCs[0].SdcIP+"__"), - kv.String("PlotWithMean", "No"), + expectedLables := []attribute.KeyValue{ + attribute.String("VolumeID", metaSecond.ID), + attribute.String("VolumeName", metaSecond.Name), + attribute.String("MappedNodeIDs", "__"+metaSecond.MappedSDCs[0].SdcID+"__"), + attribute.String("MappedNodeIPs", "__"+metaSecond.MappedSDCs[0].SdcIP+"__"), + attribute.String("PlotWithMean", "No"), } ctrl := gomock.NewController(t) meter := mocks.NewMockFloat64UpDownCounterCreater(ctrl) + provider := mocks.NewMockInstrumentProvider(ctrl) otMeter := global.Meter("powerflex_volume__test") - readBW, err := otMeter.NewFloat64UpDownCounter("powerflex_volume_read_bw_megabytes_per_second") + readBW, err := otMeter.AsyncFloat64().UpDownCounter("powerflex_volume_read_bw_megabytes_per_second") if err != nil { t.Fatal(err) } - writeBW, err := otMeter.NewFloat64UpDownCounter("powerflex_volume_write_bw_megabytes_per_second") + writeBW, err := otMeter.AsyncFloat64().UpDownCounter("powerflex_volume_write_bw_megabytes_per_second") if err != nil { t.Fatal(err) } - readIOPS, err := otMeter.NewFloat64UpDownCounter("powerflex_volume_read_iops_per_second") + readIOPS, err := otMeter.AsyncFloat64().UpDownCounter("powerflex_volume_read_iops_per_second") if err != nil { t.Fatal(err) } - writeIOPS, err := otMeter.NewFloat64UpDownCounter("powerflex_volume_write_iops_per_second") + writeIOPS, err := otMeter.AsyncFloat64().UpDownCounter("powerflex_volume_write_iops_per_second") if err != nil { t.Fatal(err) } - readLatency, err := otMeter.NewFloat64UpDownCounter("powerflex_volume_read_latency_milliseconds") + readLatency, err := otMeter.AsyncFloat64().UpDownCounter("powerflex_volume_read_latency_milliseconds") if err != nil { t.Fatal(err) } - writeLatency, err := otMeter.NewFloat64UpDownCounter("powerflex_volume_write_latency_milliseconds") + writeLatency, err := otMeter.AsyncFloat64().UpDownCounter("powerflex_volume_write_latency_milliseconds") if err != nil { t.Fatal(err) } - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(readBW, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(writeBW, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(readIOPS, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(writeIOPS, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(readLatency, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(writeLatency, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(readBW, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(writeBW, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(readIOPS, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(writeIOPS, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(readLatency, nil) - meter.EXPECT().NewFloat64UpDownCounter(gomock.Any()).Return(writeLatency, nil) + meter.EXPECT().AsyncFloat64().Return(provider).Times(12) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(readBW, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(writeBW, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(readIOPS, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(writeIOPS, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(readLatency, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(writeLatency, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(readBW, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(writeBW, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(readIOPS, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(writeIOPS, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(readLatency, nil) + provider.EXPECT().UpDownCounter(gomock.Any()).Return(writeLatency, nil) mw := &service.MetricsWrapper{ Meter: meter, @@ -519,7 +570,7 @@ func Test_Volume_Metrics_Label_Update(t *testing.T) { if !ok { t.Errorf("expected labels to exist for %v, but did not find them", metaFirst.ID) } - labels := newLabels.([]kv.KeyValue) + labels := newLabels.([]attribute.KeyValue) for _, l := range labels { for _, e := range expectedLables { if l.Key == e.Key { diff --git a/internal/service/mocks/instrument_provider_mocks.go b/internal/service/mocks/instrument_provider_mocks.go new file mode 100644 index 0000000..2a9c631 --- /dev/null +++ b/internal/service/mocks/instrument_provider_mocks.go @@ -0,0 +1,96 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: go.opentelemetry.io/otel/metric/instrument/asyncfloat64 (interfaces: InstrumentProvider) + +// Package mocks is a generated GoMock package. +package mocks + +import ( + reflect "reflect" + + gomock "github.com/golang/mock/gomock" + instrument "go.opentelemetry.io/otel/metric/instrument" + asyncfloat64 "go.opentelemetry.io/otel/metric/instrument/asyncfloat64" +) + +// MockInstrumentProvider is a mock of InstrumentProvider interface. +type MockInstrumentProvider struct { + ctrl *gomock.Controller + recorder *MockInstrumentProviderMockRecorder +} + +// MockInstrumentProviderMockRecorder is the mock recorder for MockInstrumentProvider. +type MockInstrumentProviderMockRecorder struct { + mock *MockInstrumentProvider +} + +// NewMockInstrumentProvider creates a new mock instance. +func NewMockInstrumentProvider(ctrl *gomock.Controller) *MockInstrumentProvider { + mock := &MockInstrumentProvider{ctrl: ctrl} + mock.recorder = &MockInstrumentProviderMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockInstrumentProvider) EXPECT() *MockInstrumentProviderMockRecorder { + return m.recorder +} + +// Counter mocks base method. +func (m *MockInstrumentProvider) Counter(arg0 string, arg1 ...instrument.Option) (asyncfloat64.Counter, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0} + for _, a := range arg1 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Counter", varargs...) + ret0, _ := ret[0].(asyncfloat64.Counter) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Counter indicates an expected call of Counter. +func (mr *MockInstrumentProviderMockRecorder) Counter(arg0 interface{}, arg1 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0}, arg1...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Counter", reflect.TypeOf((*MockInstrumentProvider)(nil).Counter), varargs...) +} + +// Gauge mocks base method. +func (m *MockInstrumentProvider) Gauge(arg0 string, arg1 ...instrument.Option) (asyncfloat64.Gauge, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0} + for _, a := range arg1 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "Gauge", varargs...) + ret0, _ := ret[0].(asyncfloat64.Gauge) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// Gauge indicates an expected call of Gauge. +func (mr *MockInstrumentProviderMockRecorder) Gauge(arg0 interface{}, arg1 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0}, arg1...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Gauge", reflect.TypeOf((*MockInstrumentProvider)(nil).Gauge), varargs...) +} + +// UpDownCounter mocks base method. +func (m *MockInstrumentProvider) UpDownCounter(arg0 string, arg1 ...instrument.Option) (asyncfloat64.UpDownCounter, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0} + for _, a := range arg1 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "UpDownCounter", varargs...) + ret0, _ := ret[0].(asyncfloat64.UpDownCounter) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UpDownCounter indicates an expected call of UpDownCounter. +func (mr *MockInstrumentProviderMockRecorder) UpDownCounter(arg0 interface{}, arg1 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0}, arg1...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpDownCounter", reflect.TypeOf((*MockInstrumentProvider)(nil).UpDownCounter), varargs...) +} diff --git a/internal/service/mocks/leader_elector_mocks.go b/internal/service/mocks/leader_elector_mocks.go index 3855d4c..07f0be6 100644 --- a/internal/service/mocks/leader_elector_mocks.go +++ b/internal/service/mocks/leader_elector_mocks.go @@ -5,34 +5,35 @@ package mocks import ( - gomock "github.com/golang/mock/gomock" reflect "reflect" + + gomock "github.com/golang/mock/gomock" ) -// MockLeaderElector is a mock of LeaderElector interface +// MockLeaderElector is a mock of LeaderElector interface. type MockLeaderElector struct { ctrl *gomock.Controller recorder *MockLeaderElectorMockRecorder } -// MockLeaderElectorMockRecorder is the mock recorder for MockLeaderElector +// MockLeaderElectorMockRecorder is the mock recorder for MockLeaderElector. type MockLeaderElectorMockRecorder struct { mock *MockLeaderElector } -// NewMockLeaderElector creates a new mock instance +// NewMockLeaderElector creates a new mock instance. func NewMockLeaderElector(ctrl *gomock.Controller) *MockLeaderElector { mock := &MockLeaderElector{ctrl: ctrl} mock.recorder = &MockLeaderElectorMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockLeaderElector) EXPECT() *MockLeaderElectorMockRecorder { return m.recorder } -// InitLeaderElection mocks base method +// InitLeaderElection mocks base method. func (m *MockLeaderElector) InitLeaderElection(arg0, arg1 string) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "InitLeaderElection", arg0, arg1) @@ -40,13 +41,13 @@ func (m *MockLeaderElector) InitLeaderElection(arg0, arg1 string) error { return ret0 } -// InitLeaderElection indicates an expected call of InitLeaderElection +// InitLeaderElection indicates an expected call of InitLeaderElection. func (mr *MockLeaderElectorMockRecorder) InitLeaderElection(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitLeaderElection", reflect.TypeOf((*MockLeaderElector)(nil).InitLeaderElection), arg0, arg1) } -// IsLeader mocks base method +// IsLeader mocks base method. func (m *MockLeaderElector) IsLeader() bool { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IsLeader") @@ -54,7 +55,7 @@ func (m *MockLeaderElector) IsLeader() bool { return ret0 } -// IsLeader indicates an expected call of IsLeader +// IsLeader indicates an expected call of IsLeader. func (mr *MockLeaderElectorMockRecorder) IsLeader() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsLeader", reflect.TypeOf((*MockLeaderElector)(nil).IsLeader)) diff --git a/internal/service/mocks/metrics_mocks.go b/internal/service/mocks/metrics_mocks.go index 6d3ded9..da62d47 100644 --- a/internal/service/mocks/metrics_mocks.go +++ b/internal/service/mocks/metrics_mocks.go @@ -6,35 +6,36 @@ package mocks import ( context "context" - gomock "github.com/golang/mock/gomock" - metric "go.opentelemetry.io/otel/api/metric" reflect "reflect" + + gomock "github.com/golang/mock/gomock" + asyncfloat64 "go.opentelemetry.io/otel/metric/instrument/asyncfloat64" ) -// MockMetricsRecorder is a mock of MetricsRecorder interface +// MockMetricsRecorder is a mock of MetricsRecorder interface. type MockMetricsRecorder struct { ctrl *gomock.Controller recorder *MockMetricsRecorderMockRecorder } -// MockMetricsRecorderMockRecorder is the mock recorder for MockMetricsRecorder +// MockMetricsRecorderMockRecorder is the mock recorder for MockMetricsRecorder. type MockMetricsRecorderMockRecorder struct { mock *MockMetricsRecorder } -// NewMockMetricsRecorder creates a new mock instance +// NewMockMetricsRecorder creates a new mock instance. func NewMockMetricsRecorder(ctrl *gomock.Controller) *MockMetricsRecorder { mock := &MockMetricsRecorder{ctrl: ctrl} mock.recorder = &MockMetricsRecorderMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockMetricsRecorder) EXPECT() *MockMetricsRecorderMockRecorder { return m.recorder } -// Record mocks base method +// Record mocks base method. func (m *MockMetricsRecorder) Record(arg0 context.Context, arg1 interface{}, arg2, arg3, arg4, arg5, arg6, arg7 float64) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Record", arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) @@ -42,13 +43,13 @@ func (m *MockMetricsRecorder) Record(arg0 context.Context, arg1 interface{}, arg return ret0 } -// Record indicates an expected call of Record +// Record indicates an expected call of Record. func (mr *MockMetricsRecorderMockRecorder) Record(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Record", reflect.TypeOf((*MockMetricsRecorder)(nil).Record), arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) } -// RecordCapacity mocks base method +// RecordCapacity mocks base method. func (m *MockMetricsRecorder) RecordCapacity(arg0 context.Context, arg1 interface{}, arg2, arg3, arg4, arg5 float64) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RecordCapacity", arg0, arg1, arg2, arg3, arg4, arg5) @@ -56,51 +57,45 @@ func (m *MockMetricsRecorder) RecordCapacity(arg0 context.Context, arg1 interfac return ret0 } -// RecordCapacity indicates an expected call of RecordCapacity +// RecordCapacity indicates an expected call of RecordCapacity. func (mr *MockMetricsRecorderMockRecorder) RecordCapacity(arg0, arg1, arg2, arg3, arg4, arg5 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RecordCapacity", reflect.TypeOf((*MockMetricsRecorder)(nil).RecordCapacity), arg0, arg1, arg2, arg3, arg4, arg5) } -// MockFloat64UpDownCounterCreater is a mock of Float64UpDownCounterCreater interface +// MockFloat64UpDownCounterCreater is a mock of Float64UpDownCounterCreater interface. type MockFloat64UpDownCounterCreater struct { ctrl *gomock.Controller recorder *MockFloat64UpDownCounterCreaterMockRecorder } -// MockFloat64UpDownCounterCreaterMockRecorder is the mock recorder for MockFloat64UpDownCounterCreater +// MockFloat64UpDownCounterCreaterMockRecorder is the mock recorder for MockFloat64UpDownCounterCreater. type MockFloat64UpDownCounterCreaterMockRecorder struct { mock *MockFloat64UpDownCounterCreater } -// NewMockFloat64UpDownCounterCreater creates a new mock instance +// NewMockFloat64UpDownCounterCreater creates a new mock instance. func NewMockFloat64UpDownCounterCreater(ctrl *gomock.Controller) *MockFloat64UpDownCounterCreater { mock := &MockFloat64UpDownCounterCreater{ctrl: ctrl} mock.recorder = &MockFloat64UpDownCounterCreaterMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockFloat64UpDownCounterCreater) EXPECT() *MockFloat64UpDownCounterCreaterMockRecorder { return m.recorder } -// NewFloat64UpDownCounter mocks base method -func (m *MockFloat64UpDownCounterCreater) NewFloat64UpDownCounter(arg0 string, arg1 ...metric.InstrumentOption) (metric.Float64UpDownCounter, error) { +// AsyncFloat64 mocks base method. +func (m *MockFloat64UpDownCounterCreater) AsyncFloat64() asyncfloat64.InstrumentProvider { m.ctrl.T.Helper() - varargs := []interface{}{arg0} - for _, a := range arg1 { - varargs = append(varargs, a) - } - ret := m.ctrl.Call(m, "NewFloat64UpDownCounter", varargs...) - ret0, _ := ret[0].(metric.Float64UpDownCounter) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret := m.ctrl.Call(m, "AsyncFloat64") + ret0, _ := ret[0].(asyncfloat64.InstrumentProvider) + return ret0 } -// NewFloat64UpDownCounter indicates an expected call of NewFloat64UpDownCounter -func (mr *MockFloat64UpDownCounterCreaterMockRecorder) NewFloat64UpDownCounter(arg0 interface{}, arg1 ...interface{}) *gomock.Call { +// AsyncFloat64 indicates an expected call of AsyncFloat64. +func (mr *MockFloat64UpDownCounterCreaterMockRecorder) AsyncFloat64() *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]interface{}{arg0}, arg1...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewFloat64UpDownCounter", reflect.TypeOf((*MockFloat64UpDownCounterCreater)(nil).NewFloat64UpDownCounter), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AsyncFloat64", reflect.TypeOf((*MockFloat64UpDownCounterCreater)(nil).AsyncFloat64)) } diff --git a/internal/service/mocks/node_finder_mocks.go b/internal/service/mocks/node_finder_mocks.go index e532558..64648e3 100644 --- a/internal/service/mocks/node_finder_mocks.go +++ b/internal/service/mocks/node_finder_mocks.go @@ -5,35 +5,36 @@ package mocks import ( + reflect "reflect" + gomock "github.com/golang/mock/gomock" v1 "k8s.io/api/core/v1" - reflect "reflect" ) -// MockNodeFinder is a mock of NodeFinder interface +// MockNodeFinder is a mock of NodeFinder interface. type MockNodeFinder struct { ctrl *gomock.Controller recorder *MockNodeFinderMockRecorder } -// MockNodeFinderMockRecorder is the mock recorder for MockNodeFinder +// MockNodeFinderMockRecorder is the mock recorder for MockNodeFinder. type MockNodeFinderMockRecorder struct { mock *MockNodeFinder } -// NewMockNodeFinder creates a new mock instance +// NewMockNodeFinder creates a new mock instance. func NewMockNodeFinder(ctrl *gomock.Controller) *MockNodeFinder { mock := &MockNodeFinder{ctrl: ctrl} mock.recorder = &MockNodeFinderMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockNodeFinder) EXPECT() *MockNodeFinderMockRecorder { return m.recorder } -// GetNodes mocks base method +// GetNodes mocks base method. func (m *MockNodeFinder) GetNodes() ([]v1.Node, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetNodes") @@ -42,7 +43,7 @@ func (m *MockNodeFinder) GetNodes() ([]v1.Node, error) { return ret0, ret1 } -// GetNodes indicates an expected call of GetNodes +// GetNodes indicates an expected call of GetNodes. func (mr *MockNodeFinderMockRecorder) GetNodes() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetNodes", reflect.TypeOf((*MockNodeFinder)(nil).GetNodes)) diff --git a/internal/service/mocks/powerflex_client_mocks.go b/internal/service/mocks/powerflex_client_mocks.go index aca67ec..3d06c7e 100644 --- a/internal/service/mocks/powerflex_client_mocks.go +++ b/internal/service/mocks/powerflex_client_mocks.go @@ -5,36 +5,37 @@ package mocks import ( + reflect "reflect" + goscaleio "github.com/dell/goscaleio" goscaleio0 "github.com/dell/goscaleio/types/v1" gomock "github.com/golang/mock/gomock" - reflect "reflect" ) -// MockPowerFlexClient is a mock of PowerFlexClient interface +// MockPowerFlexClient is a mock of PowerFlexClient interface. type MockPowerFlexClient struct { ctrl *gomock.Controller recorder *MockPowerFlexClientMockRecorder } -// MockPowerFlexClientMockRecorder is the mock recorder for MockPowerFlexClient +// MockPowerFlexClientMockRecorder is the mock recorder for MockPowerFlexClient. type MockPowerFlexClientMockRecorder struct { mock *MockPowerFlexClient } -// NewMockPowerFlexClient creates a new mock instance +// NewMockPowerFlexClient creates a new mock instance. func NewMockPowerFlexClient(ctrl *gomock.Controller) *MockPowerFlexClient { mock := &MockPowerFlexClient{ctrl: ctrl} mock.recorder = &MockPowerFlexClientMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockPowerFlexClient) EXPECT() *MockPowerFlexClientMockRecorder { return m.recorder } -// Authenticate mocks base method +// Authenticate mocks base method. func (m *MockPowerFlexClient) Authenticate(arg0 *goscaleio.ConfigConnect) (goscaleio.Cluster, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Authenticate", arg0) @@ -43,13 +44,13 @@ func (m *MockPowerFlexClient) Authenticate(arg0 *goscaleio.ConfigConnect) (gosca return ret0, ret1 } -// Authenticate indicates an expected call of Authenticate +// Authenticate indicates an expected call of Authenticate. func (mr *MockPowerFlexClientMockRecorder) Authenticate(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Authenticate", reflect.TypeOf((*MockPowerFlexClient)(nil).Authenticate), arg0) } -// FindSystem mocks base method +// FindSystem mocks base method. func (m *MockPowerFlexClient) FindSystem(arg0, arg1, arg2 string) (*goscaleio.System, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "FindSystem", arg0, arg1, arg2) @@ -58,13 +59,13 @@ func (m *MockPowerFlexClient) FindSystem(arg0, arg1, arg2 string) (*goscaleio.Sy return ret0, ret1 } -// FindSystem indicates an expected call of FindSystem +// FindSystem indicates an expected call of FindSystem. func (mr *MockPowerFlexClientMockRecorder) FindSystem(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindSystem", reflect.TypeOf((*MockPowerFlexClient)(nil).FindSystem), arg0, arg1, arg2) } -// GetInstance mocks base method +// GetInstance mocks base method. func (m *MockPowerFlexClient) GetInstance(arg0 string) ([]*goscaleio0.System, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetInstance", arg0) @@ -73,13 +74,13 @@ func (m *MockPowerFlexClient) GetInstance(arg0 string) ([]*goscaleio0.System, er return ret0, ret1 } -// GetInstance indicates an expected call of GetInstance +// GetInstance indicates an expected call of GetInstance. func (mr *MockPowerFlexClientMockRecorder) GetInstance(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetInstance", reflect.TypeOf((*MockPowerFlexClient)(nil).GetInstance), arg0) } -// GetStoragePool mocks base method +// GetStoragePool mocks base method. func (m *MockPowerFlexClient) GetStoragePool(arg0 string) ([]*goscaleio0.StoragePool, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetStoragePool", arg0) @@ -88,7 +89,7 @@ func (m *MockPowerFlexClient) GetStoragePool(arg0 string) ([]*goscaleio0.Storage return ret0, ret1 } -// GetStoragePool indicates an expected call of GetStoragePool +// GetStoragePool indicates an expected call of GetStoragePool. func (mr *MockPowerFlexClientMockRecorder) GetStoragePool(arg0 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStoragePool", reflect.TypeOf((*MockPowerFlexClient)(nil).GetStoragePool), arg0) diff --git a/internal/service/mocks/powerflex_system_mocks.go b/internal/service/mocks/powerflex_system_mocks.go index bafea84..df4d64d 100644 --- a/internal/service/mocks/powerflex_system_mocks.go +++ b/internal/service/mocks/powerflex_system_mocks.go @@ -5,35 +5,36 @@ package mocks import ( + reflect "reflect" + goscaleio "github.com/dell/goscaleio" gomock "github.com/golang/mock/gomock" - reflect "reflect" ) -// MockPowerFlexSystem is a mock of PowerFlexSystem interface +// MockPowerFlexSystem is a mock of PowerFlexSystem interface. type MockPowerFlexSystem struct { ctrl *gomock.Controller recorder *MockPowerFlexSystemMockRecorder } -// MockPowerFlexSystemMockRecorder is the mock recorder for MockPowerFlexSystem +// MockPowerFlexSystemMockRecorder is the mock recorder for MockPowerFlexSystem. type MockPowerFlexSystemMockRecorder struct { mock *MockPowerFlexSystem } -// NewMockPowerFlexSystem creates a new mock instance +// NewMockPowerFlexSystem creates a new mock instance. func NewMockPowerFlexSystem(ctrl *gomock.Controller) *MockPowerFlexSystem { mock := &MockPowerFlexSystem{ctrl: ctrl} mock.recorder = &MockPowerFlexSystemMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockPowerFlexSystem) EXPECT() *MockPowerFlexSystemMockRecorder { return m.recorder } -// FindSdc mocks base method +// FindSdc mocks base method. func (m *MockPowerFlexSystem) FindSdc(arg0, arg1 string) (*goscaleio.Sdc, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "FindSdc", arg0, arg1) @@ -42,7 +43,7 @@ func (m *MockPowerFlexSystem) FindSdc(arg0, arg1 string) (*goscaleio.Sdc, error) return ret0, ret1 } -// FindSdc indicates an expected call of FindSdc +// FindSdc indicates an expected call of FindSdc. func (mr *MockPowerFlexSystemMockRecorder) FindSdc(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindSdc", reflect.TypeOf((*MockPowerFlexSystem)(nil).FindSdc), arg0, arg1) diff --git a/internal/service/mocks/sdc_finder_mocks.go b/internal/service/mocks/sdc_finder_mocks.go index f73ba66..5c4bf81 100644 --- a/internal/service/mocks/sdc_finder_mocks.go +++ b/internal/service/mocks/sdc_finder_mocks.go @@ -5,34 +5,35 @@ package mocks import ( - gomock "github.com/golang/mock/gomock" reflect "reflect" + + gomock "github.com/golang/mock/gomock" ) -// MockSDCFinder is a mock of SDCFinder interface +// MockSDCFinder is a mock of SDCFinder interface. type MockSDCFinder struct { ctrl *gomock.Controller recorder *MockSDCFinderMockRecorder } -// MockSDCFinderMockRecorder is the mock recorder for MockSDCFinder +// MockSDCFinderMockRecorder is the mock recorder for MockSDCFinder. type MockSDCFinderMockRecorder struct { mock *MockSDCFinder } -// NewMockSDCFinder creates a new mock instance +// NewMockSDCFinder creates a new mock instance. func NewMockSDCFinder(ctrl *gomock.Controller) *MockSDCFinder { mock := &MockSDCFinder{ctrl: ctrl} mock.recorder = &MockSDCFinderMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockSDCFinder) EXPECT() *MockSDCFinderMockRecorder { return m.recorder } -// GetSDCGuids mocks base method +// GetSDCGuids mocks base method. func (m *MockSDCFinder) GetSDCGuids() ([]string, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetSDCGuids") @@ -41,7 +42,7 @@ func (m *MockSDCFinder) GetSDCGuids() ([]string, error) { return ret0, ret1 } -// GetSDCGuids indicates an expected call of GetSDCGuids +// GetSDCGuids indicates an expected call of GetSDCGuids. func (mr *MockSDCFinderMockRecorder) GetSDCGuids() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSDCGuids", reflect.TypeOf((*MockSDCFinder)(nil).GetSDCGuids)) diff --git a/internal/service/mocks/service_mocks.go b/internal/service/mocks/service_mocks.go index daa2e33..2187e51 100644 --- a/internal/service/mocks/service_mocks.go +++ b/internal/service/mocks/service_mocks.go @@ -6,60 +6,61 @@ package mocks import ( context "context" + reflect "reflect" + service "github.com/dell/karavi-metrics-powerflex/internal/service" gomock "github.com/golang/mock/gomock" v1 "k8s.io/api/core/v1" - reflect "reflect" ) -// MockService is a mock of Service interface +// MockService is a mock of Service interface. type MockService struct { ctrl *gomock.Controller recorder *MockServiceMockRecorder } -// MockServiceMockRecorder is the mock recorder for MockService +// MockServiceMockRecorder is the mock recorder for MockService. type MockServiceMockRecorder struct { mock *MockService } -// NewMockService creates a new mock instance +// NewMockService creates a new mock instance. func NewMockService(ctrl *gomock.Controller) *MockService { mock := &MockService{ctrl: ctrl} mock.recorder = &MockServiceMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockService) EXPECT() *MockServiceMockRecorder { return m.recorder } -// ExportVolumeStatistics mocks base method +// ExportVolumeStatistics mocks base method. func (m *MockService) ExportVolumeStatistics(arg0 context.Context, arg1 []service.VolumeStatisticsGetter, arg2 service.VolumeFinder) { m.ctrl.T.Helper() m.ctrl.Call(m, "ExportVolumeStatistics", arg0, arg1, arg2) } -// ExportVolumeStatistics indicates an expected call of ExportVolumeStatistics +// ExportVolumeStatistics indicates an expected call of ExportVolumeStatistics. func (mr *MockServiceMockRecorder) ExportVolumeStatistics(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ExportVolumeStatistics", reflect.TypeOf((*MockService)(nil).ExportVolumeStatistics), arg0, arg1, arg2) } -// GetSDCStatistics mocks base method +// GetSDCStatistics mocks base method. func (m *MockService) GetSDCStatistics(arg0 context.Context, arg1 []v1.Node, arg2 []service.StatisticsGetter) { m.ctrl.T.Helper() m.ctrl.Call(m, "GetSDCStatistics", arg0, arg1, arg2) } -// GetSDCStatistics indicates an expected call of GetSDCStatistics +// GetSDCStatistics indicates an expected call of GetSDCStatistics. func (mr *MockServiceMockRecorder) GetSDCStatistics(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSDCStatistics", reflect.TypeOf((*MockService)(nil).GetSDCStatistics), arg0, arg1, arg2) } -// GetSDCs mocks base method +// GetSDCs mocks base method. func (m *MockService) GetSDCs(arg0 context.Context, arg1 service.PowerFlexClient, arg2 service.SDCFinder) ([]service.StatisticsGetter, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetSDCs", arg0, arg1, arg2) @@ -68,13 +69,13 @@ func (m *MockService) GetSDCs(arg0 context.Context, arg1 service.PowerFlexClient return ret0, ret1 } -// GetSDCs indicates an expected call of GetSDCs +// GetSDCs indicates an expected call of GetSDCs. func (mr *MockServiceMockRecorder) GetSDCs(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSDCs", reflect.TypeOf((*MockService)(nil).GetSDCs), arg0, arg1, arg2) } -// GetStorageClasses mocks base method +// GetStorageClasses mocks base method. func (m *MockService) GetStorageClasses(arg0 context.Context, arg1 service.PowerFlexClient, arg2 service.StorageClassFinder) ([]service.StorageClassMeta, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetStorageClasses", arg0, arg1, arg2) @@ -83,25 +84,25 @@ func (m *MockService) GetStorageClasses(arg0 context.Context, arg1 service.Power return ret0, ret1 } -// GetStorageClasses indicates an expected call of GetStorageClasses +// GetStorageClasses indicates an expected call of GetStorageClasses. func (mr *MockServiceMockRecorder) GetStorageClasses(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageClasses", reflect.TypeOf((*MockService)(nil).GetStorageClasses), arg0, arg1, arg2) } -// GetStoragePoolStatistics mocks base method +// GetStoragePoolStatistics mocks base method. func (m *MockService) GetStoragePoolStatistics(arg0 context.Context, arg1 []service.StorageClassMeta) { m.ctrl.T.Helper() m.ctrl.Call(m, "GetStoragePoolStatistics", arg0, arg1) } -// GetStoragePoolStatistics indicates an expected call of GetStoragePoolStatistics +// GetStoragePoolStatistics indicates an expected call of GetStoragePoolStatistics. func (mr *MockServiceMockRecorder) GetStoragePoolStatistics(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStoragePoolStatistics", reflect.TypeOf((*MockService)(nil).GetStoragePoolStatistics), arg0, arg1) } -// GetVolumes mocks base method +// GetVolumes mocks base method. func (m *MockService) GetVolumes(arg0 context.Context, arg1 []service.StatisticsGetter) ([]service.VolumeStatisticsGetter, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetVolumes", arg0, arg1) @@ -110,7 +111,7 @@ func (m *MockService) GetVolumes(arg0 context.Context, arg1 []service.Statistics return ret0, ret1 } -// GetVolumes indicates an expected call of GetVolumes +// GetVolumes indicates an expected call of GetVolumes. func (mr *MockServiceMockRecorder) GetVolumes(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVolumes", reflect.TypeOf((*MockService)(nil).GetVolumes), arg0, arg1) diff --git a/internal/service/mocks/statistics_getter_mocks.go b/internal/service/mocks/statistics_getter_mocks.go index fa3aaa8..adbd304 100644 --- a/internal/service/mocks/statistics_getter_mocks.go +++ b/internal/service/mocks/statistics_getter_mocks.go @@ -5,36 +5,37 @@ package mocks import ( + reflect "reflect" + goscaleio "github.com/dell/goscaleio" goscaleio0 "github.com/dell/goscaleio/types/v1" gomock "github.com/golang/mock/gomock" - reflect "reflect" ) -// MockStatisticsGetter is a mock of StatisticsGetter interface +// MockStatisticsGetter is a mock of StatisticsGetter interface. type MockStatisticsGetter struct { ctrl *gomock.Controller recorder *MockStatisticsGetterMockRecorder } -// MockStatisticsGetterMockRecorder is the mock recorder for MockStatisticsGetter +// MockStatisticsGetterMockRecorder is the mock recorder for MockStatisticsGetter. type MockStatisticsGetterMockRecorder struct { mock *MockStatisticsGetter } -// NewMockStatisticsGetter creates a new mock instance +// NewMockStatisticsGetter creates a new mock instance. func NewMockStatisticsGetter(ctrl *gomock.Controller) *MockStatisticsGetter { mock := &MockStatisticsGetter{ctrl: ctrl} mock.recorder = &MockStatisticsGetterMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockStatisticsGetter) EXPECT() *MockStatisticsGetterMockRecorder { return m.recorder } -// FindVolumes mocks base method +// FindVolumes mocks base method. func (m *MockStatisticsGetter) FindVolumes() ([]*goscaleio.Volume, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "FindVolumes") @@ -43,13 +44,13 @@ func (m *MockStatisticsGetter) FindVolumes() ([]*goscaleio.Volume, error) { return ret0, ret1 } -// FindVolumes indicates an expected call of FindVolumes +// FindVolumes indicates an expected call of FindVolumes. func (mr *MockStatisticsGetterMockRecorder) FindVolumes() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindVolumes", reflect.TypeOf((*MockStatisticsGetter)(nil).FindVolumes)) } -// GetStatistics mocks base method +// GetStatistics mocks base method. func (m *MockStatisticsGetter) GetStatistics() (*goscaleio0.SdcStatistics, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetStatistics") @@ -58,13 +59,13 @@ func (m *MockStatisticsGetter) GetStatistics() (*goscaleio0.SdcStatistics, error return ret0, ret1 } -// GetStatistics indicates an expected call of GetStatistics +// GetStatistics indicates an expected call of GetStatistics. func (mr *MockStatisticsGetterMockRecorder) GetStatistics() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStatistics", reflect.TypeOf((*MockStatisticsGetter)(nil).GetStatistics)) } -// GetVolume mocks base method +// GetVolume mocks base method. func (m *MockStatisticsGetter) GetVolume() ([]*goscaleio0.Volume, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetVolume") @@ -73,7 +74,7 @@ func (m *MockStatisticsGetter) GetVolume() ([]*goscaleio0.Volume, error) { return ret0, ret1 } -// GetVolume indicates an expected call of GetVolume +// GetVolume indicates an expected call of GetVolume. func (mr *MockStatisticsGetterMockRecorder) GetVolume() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVolume", reflect.TypeOf((*MockStatisticsGetter)(nil).GetVolume)) diff --git a/internal/service/mocks/storage_class_finder_mocks.go b/internal/service/mocks/storage_class_finder_mocks.go index c385658..a0576b9 100644 --- a/internal/service/mocks/storage_class_finder_mocks.go +++ b/internal/service/mocks/storage_class_finder_mocks.go @@ -5,35 +5,36 @@ package mocks import ( + reflect "reflect" + gomock "github.com/golang/mock/gomock" v1 "k8s.io/api/storage/v1" - reflect "reflect" ) -// MockStorageClassFinder is a mock of StorageClassFinder interface +// MockStorageClassFinder is a mock of StorageClassFinder interface. type MockStorageClassFinder struct { ctrl *gomock.Controller recorder *MockStorageClassFinderMockRecorder } -// MockStorageClassFinderMockRecorder is the mock recorder for MockStorageClassFinder +// MockStorageClassFinderMockRecorder is the mock recorder for MockStorageClassFinder. type MockStorageClassFinderMockRecorder struct { mock *MockStorageClassFinder } -// NewMockStorageClassFinder creates a new mock instance +// NewMockStorageClassFinder creates a new mock instance. func NewMockStorageClassFinder(ctrl *gomock.Controller) *MockStorageClassFinder { mock := &MockStorageClassFinder{ctrl: ctrl} mock.recorder = &MockStorageClassFinderMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockStorageClassFinder) EXPECT() *MockStorageClassFinderMockRecorder { return m.recorder } -// GetStorageClasses mocks base method +// GetStorageClasses mocks base method. func (m *MockStorageClassFinder) GetStorageClasses() ([]v1.StorageClass, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetStorageClasses") @@ -42,7 +43,7 @@ func (m *MockStorageClassFinder) GetStorageClasses() ([]v1.StorageClass, error) return ret0, ret1 } -// GetStorageClasses indicates an expected call of GetStorageClasses +// GetStorageClasses indicates an expected call of GetStorageClasses. func (mr *MockStorageClassFinderMockRecorder) GetStorageClasses() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStorageClasses", reflect.TypeOf((*MockStorageClassFinder)(nil).GetStorageClasses)) diff --git a/internal/service/mocks/storage_pool_statistics_getter_mocks.go b/internal/service/mocks/storage_pool_statistics_getter_mocks.go index 2839ab5..8b549a3 100644 --- a/internal/service/mocks/storage_pool_statistics_getter_mocks.go +++ b/internal/service/mocks/storage_pool_statistics_getter_mocks.go @@ -5,35 +5,36 @@ package mocks import ( + reflect "reflect" + goscaleio "github.com/dell/goscaleio/types/v1" gomock "github.com/golang/mock/gomock" - reflect "reflect" ) -// MockStoragePoolStatisticsGetter is a mock of StoragePoolStatisticsGetter interface +// MockStoragePoolStatisticsGetter is a mock of StoragePoolStatisticsGetter interface. type MockStoragePoolStatisticsGetter struct { ctrl *gomock.Controller recorder *MockStoragePoolStatisticsGetterMockRecorder } -// MockStoragePoolStatisticsGetterMockRecorder is the mock recorder for MockStoragePoolStatisticsGetter +// MockStoragePoolStatisticsGetterMockRecorder is the mock recorder for MockStoragePoolStatisticsGetter. type MockStoragePoolStatisticsGetterMockRecorder struct { mock *MockStoragePoolStatisticsGetter } -// NewMockStoragePoolStatisticsGetter creates a new mock instance +// NewMockStoragePoolStatisticsGetter creates a new mock instance. func NewMockStoragePoolStatisticsGetter(ctrl *gomock.Controller) *MockStoragePoolStatisticsGetter { mock := &MockStoragePoolStatisticsGetter{ctrl: ctrl} mock.recorder = &MockStoragePoolStatisticsGetterMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockStoragePoolStatisticsGetter) EXPECT() *MockStoragePoolStatisticsGetterMockRecorder { return m.recorder } -// GetStatistics mocks base method +// GetStatistics mocks base method. func (m *MockStoragePoolStatisticsGetter) GetStatistics() (*goscaleio.Statistics, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetStatistics") @@ -42,7 +43,7 @@ func (m *MockStoragePoolStatisticsGetter) GetStatistics() (*goscaleio.Statistics return ret0, ret1 } -// GetStatistics indicates an expected call of GetStatistics +// GetStatistics indicates an expected call of GetStatistics. func (mr *MockStoragePoolStatisticsGetterMockRecorder) GetStatistics() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStatistics", reflect.TypeOf((*MockStoragePoolStatisticsGetter)(nil).GetStatistics)) diff --git a/internal/service/mocks/volume_finder_mocks.go b/internal/service/mocks/volume_finder_mocks.go index 6ab0a9e..bb4cbf8 100644 --- a/internal/service/mocks/volume_finder_mocks.go +++ b/internal/service/mocks/volume_finder_mocks.go @@ -5,35 +5,36 @@ package mocks import ( + reflect "reflect" + k8s "github.com/dell/karavi-metrics-powerflex/internal/k8s" gomock "github.com/golang/mock/gomock" - reflect "reflect" ) -// MockVolumeFinder is a mock of VolumeFinder interface +// MockVolumeFinder is a mock of VolumeFinder interface. type MockVolumeFinder struct { ctrl *gomock.Controller recorder *MockVolumeFinderMockRecorder } -// MockVolumeFinderMockRecorder is the mock recorder for MockVolumeFinder +// MockVolumeFinderMockRecorder is the mock recorder for MockVolumeFinder. type MockVolumeFinderMockRecorder struct { mock *MockVolumeFinder } -// NewMockVolumeFinder creates a new mock instance +// NewMockVolumeFinder creates a new mock instance. func NewMockVolumeFinder(ctrl *gomock.Controller) *MockVolumeFinder { mock := &MockVolumeFinder{ctrl: ctrl} mock.recorder = &MockVolumeFinderMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockVolumeFinder) EXPECT() *MockVolumeFinderMockRecorder { return m.recorder } -// GetPersistentVolumes mocks base method +// GetPersistentVolumes mocks base method. func (m *MockVolumeFinder) GetPersistentVolumes() ([]k8s.VolumeInfo, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetPersistentVolumes") @@ -42,7 +43,7 @@ func (m *MockVolumeFinder) GetPersistentVolumes() ([]k8s.VolumeInfo, error) { return ret0, ret1 } -// GetPersistentVolumes indicates an expected call of GetPersistentVolumes +// GetPersistentVolumes indicates an expected call of GetPersistentVolumes. func (mr *MockVolumeFinderMockRecorder) GetPersistentVolumes() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetPersistentVolumes", reflect.TypeOf((*MockVolumeFinder)(nil).GetPersistentVolumes)) diff --git a/internal/service/mocks/volume_statistics_getter_mocks.go b/internal/service/mocks/volume_statistics_getter_mocks.go index ea19c1e..321c789 100644 --- a/internal/service/mocks/volume_statistics_getter_mocks.go +++ b/internal/service/mocks/volume_statistics_getter_mocks.go @@ -5,35 +5,36 @@ package mocks import ( + reflect "reflect" + goscaleio "github.com/dell/goscaleio/types/v1" gomock "github.com/golang/mock/gomock" - reflect "reflect" ) -// MockVolumeStatisticsGetter is a mock of VolumeStatisticsGetter interface +// MockVolumeStatisticsGetter is a mock of VolumeStatisticsGetter interface. type MockVolumeStatisticsGetter struct { ctrl *gomock.Controller recorder *MockVolumeStatisticsGetterMockRecorder } -// MockVolumeStatisticsGetterMockRecorder is the mock recorder for MockVolumeStatisticsGetter +// MockVolumeStatisticsGetterMockRecorder is the mock recorder for MockVolumeStatisticsGetter. type MockVolumeStatisticsGetterMockRecorder struct { mock *MockVolumeStatisticsGetter } -// NewMockVolumeStatisticsGetter creates a new mock instance +// NewMockVolumeStatisticsGetter creates a new mock instance. func NewMockVolumeStatisticsGetter(ctrl *gomock.Controller) *MockVolumeStatisticsGetter { mock := &MockVolumeStatisticsGetter{ctrl: ctrl} mock.recorder = &MockVolumeStatisticsGetterMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockVolumeStatisticsGetter) EXPECT() *MockVolumeStatisticsGetterMockRecorder { return m.recorder } -// GetVolumeStatistics mocks base method +// GetVolumeStatistics mocks base method. func (m *MockVolumeStatisticsGetter) GetVolumeStatistics() (*goscaleio.VolumeStatistics, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetVolumeStatistics") @@ -42,7 +43,7 @@ func (m *MockVolumeStatisticsGetter) GetVolumeStatistics() (*goscaleio.VolumeSta return ret0, ret1 } -// GetVolumeStatistics indicates an expected call of GetVolumeStatistics +// GetVolumeStatistics indicates an expected call of GetVolumeStatistics. func (mr *MockVolumeStatisticsGetterMockRecorder) GetVolumeStatistics() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVolumeStatistics", reflect.TypeOf((*MockVolumeStatisticsGetter)(nil).GetVolumeStatistics)) diff --git a/internal/service/service_test.go b/internal/service/service_test.go index 0b3e91b..1442555 100644 --- a/internal/service/service_test.go +++ b/internal/service/service_test.go @@ -23,7 +23,7 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" - "go.opentelemetry.io/otel/api/global" + "go.opentelemetry.io/otel/metric/global" sio "github.com/dell/goscaleio" types "github.com/dell/goscaleio/types/v1" diff --git a/opentelemetry/exporters/mocks/otlexporters_mocks.go b/opentelemetry/exporters/mocks/otlexporters_mocks.go index ce05bec..2b91b18 100644 --- a/opentelemetry/exporters/mocks/otlexporters_mocks.go +++ b/opentelemetry/exporters/mocks/otlexporters_mocks.go @@ -5,36 +5,37 @@ package exportermocks import ( - gomock "github.com/golang/mock/gomock" - otlp "go.opentelemetry.io/otel/exporters/otlp" reflect "reflect" + + gomock "github.com/golang/mock/gomock" + otlpmetricgrpc "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc" ) -// MockOtlexporter is a mock of Otlexporter interface +// MockOtlexporter is a mock of Otlexporter interface. type MockOtlexporter struct { ctrl *gomock.Controller recorder *MockOtlexporterMockRecorder } -// MockOtlexporterMockRecorder is the mock recorder for MockOtlexporter +// MockOtlexporterMockRecorder is the mock recorder for MockOtlexporter. type MockOtlexporterMockRecorder struct { mock *MockOtlexporter } -// NewMockOtlexporter creates a new mock instance +// NewMockOtlexporter creates a new mock instance. func NewMockOtlexporter(ctrl *gomock.Controller) *MockOtlexporter { mock := &MockOtlexporter{ctrl: ctrl} mock.recorder = &MockOtlexporterMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockOtlexporter) EXPECT() *MockOtlexporterMockRecorder { return m.recorder } -// InitExporter mocks base method -func (m *MockOtlexporter) InitExporter(arg0 ...otlp.ExporterOption) error { +// InitExporter mocks base method. +func (m *MockOtlexporter) InitExporter(arg0 ...otlpmetricgrpc.Option) error { m.ctrl.T.Helper() varargs := []interface{}{} for _, a := range arg0 { @@ -45,13 +46,13 @@ func (m *MockOtlexporter) InitExporter(arg0 ...otlp.ExporterOption) error { return ret0 } -// InitExporter indicates an expected call of InitExporter +// InitExporter indicates an expected call of InitExporter. func (mr *MockOtlexporterMockRecorder) InitExporter(arg0 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InitExporter", reflect.TypeOf((*MockOtlexporter)(nil).InitExporter), arg0...) } -// StopExporter mocks base method +// StopExporter mocks base method. func (m *MockOtlexporter) StopExporter() error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StopExporter") @@ -59,7 +60,7 @@ func (m *MockOtlexporter) StopExporter() error { return ret0 } -// StopExporter indicates an expected call of StopExporter +// StopExporter indicates an expected call of StopExporter. func (mr *MockOtlexporterMockRecorder) StopExporter() *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StopExporter", reflect.TypeOf((*MockOtlexporter)(nil).StopExporter)) diff --git a/opentelemetry/exporters/opentelemetry_collector_exporter.go b/opentelemetry/exporters/opentelemetry_collector_exporter.go index cf8c578..46b5a5f 100644 --- a/opentelemetry/exporters/opentelemetry_collector_exporter.go +++ b/opentelemetry/exporters/opentelemetry_collector_exporter.go @@ -9,19 +9,22 @@ package otlexporters // http://www.apache.org/licenses/LICENSE-2.0 import ( + "context" "time" - "go.opentelemetry.io/otel/api/global" - "go.opentelemetry.io/otel/exporters/otlp" - "go.opentelemetry.io/otel/sdk/metric/controller/push" + "go.opentelemetry.io/otel/exporters/otlp/otlpmetric" + "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc" + "go.opentelemetry.io/otel/metric/global" + controller "go.opentelemetry.io/otel/sdk/metric/controller/basic" + "go.opentelemetry.io/otel/sdk/metric/processor/basic" "go.opentelemetry.io/otel/sdk/metric/selector/simple" ) // OtlCollectorExporter is the exporter for the OpenTelemetry Collector type OtlCollectorExporter struct { CollectorAddr string - exporter *otlp.Exporter - pusher *push.Controller + exporter *otlpmetric.Exporter + controller *controller.Controller } const ( @@ -30,42 +33,60 @@ const ( ) // InitExporter is the initialization method for the OpenTelemetry Collector exporter -func (c *OtlCollectorExporter) InitExporter(opts ...otlp.ExporterOption) error { - exporter, pusher, err := c.initOTLPExporter(opts...) +func (c *OtlCollectorExporter) InitExporter(opts ...otlpmetricgrpc.Option) error { + exporter, controller, err := c.initOTLPExporter(opts...) if err != nil { return err } c.exporter = exporter - c.pusher = pusher + c.controller = controller return err } // StopExporter stops the activity of the Otl Collector's required services func (c *OtlCollectorExporter) StopExporter() error { - err := c.exporter.Stop() + err := c.exporter.Shutdown(context.Background()) if err != nil { return err } - c.pusher.Stop() + + err = c.controller.Stop(context.Background()) + if err != nil { + return err + } + return nil } -func (c *OtlCollectorExporter) initOTLPExporter(opts ...otlp.ExporterOption) (*otlp.Exporter, *push.Controller, error) { - exporter, err := otlp.NewExporter(opts...) +func (c *OtlCollectorExporter) initOTLPExporter(opts ...otlpmetricgrpc.Option) (*otlpmetric.Exporter, *controller.Controller, error) { + exporter, err := otlpmetricgrpc.New(context.Background(), opts...) if err != nil { return nil, nil, err } - pusher := push.New( - simple.NewWithExactDistribution(), + processor := basic.New( + simple.NewWithHistogramDistribution(), exporter, - push.WithPeriod(5*time.Second), ) - pusher.Start() + factory := basic.NewFactory( + processor.AggregatorSelector, + processor.TemporalitySelector, + ) + + ctrl := controller.New( + factory, + controller.WithExporter(exporter), + controller.WithCollectPeriod(5*time.Second), + ) + + err = ctrl.Start(context.Background()) + if err != nil { + return nil, nil, err + } - global.SetMeterProvider(pusher.Provider()) + global.SetMeterProvider(ctrl) - return exporter, pusher, nil + return exporter, ctrl, nil } diff --git a/opentelemetry/exporters/types.go b/opentelemetry/exporters/types.go index bb51ba2..7ba83ef 100644 --- a/opentelemetry/exporters/types.go +++ b/opentelemetry/exporters/types.go @@ -1,6 +1,6 @@ package otlexporters -import "go.opentelemetry.io/otel/exporters/otlp" +import "go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc" // Copyright (c) 2020 Dell Inc., or its subsidiaries. All Rights Reserved. // @@ -13,6 +13,6 @@ import "go.opentelemetry.io/otel/exporters/otlp" // Otlexporter is an interface for all OpenTelemetry exporters //go:generate mockgen -destination=mocks/otlexporters_mocks.go -package=exportermocks github.com/dell/karavi-metrics-powerflex/opentelemetry/exporters Otlexporter type Otlexporter interface { - InitExporter(...otlp.ExporterOption) error + InitExporter(...otlpmetricgrpc.Option) error StopExporter() error }