Skip to content

Commit

Permalink
Revamp all otel references and implementations (#108)
Browse files Browse the repository at this point in the history
* updated the otel_collector_exporter file

Signed-off-by: shefali-malhotra <[email protected]>

* metrics update

Signed-off-by: nitesh3108 <[email protected]>

* Revert "metrics update"

This reverts commit 27a00ef.

* meter and observer update

Signed-off-by: nitesh3108 <[email protected]>

* meter update

Signed-off-by: nitesh3108 <[email protected]>

* fixed the go mod tidy and generated the mocks

Signed-off-by: shefali-malhotra <[email protected]>

* fixed the observer issue in metrics.go

Signed-off-by: shefali-malhotra <[email protected]>

* Implement RegisterCallback method

* fixed the otel exporter

Signed-off-by: shefali-malhotra <[email protected]>

* update RegisterCallback method implementation

* update exporter and registercallback

Signed-off-by: nitesh3108 <[email protected]>

* update Meter, update method names and regenerate mock files

* Migrated deprecated methods in the test file.

* write success unit test cases for metrics methods

* Add unit test cases for label update

* update filesystem metrics unit tests

* update space volume meta nfs based unit test

* update error handling for static parameters

* update unit test for RecordStorageClassSpaceMetrics label update

* update unit test for RecordArraySpaceMetrics label update

* unused context

Signed-off-by: nitesh3108 <[email protected]>

* remove unreachable code

* upgraded gopkg.in/yaml.v3 module

---------

Signed-off-by: shefali-malhotra <[email protected]>
Signed-off-by: nitesh3108 <[email protected]>
Co-authored-by: shefali-malhotra <[email protected]>
Co-authored-by: Chiman Jain <[email protected]>
  • Loading branch information
3 people authored Dec 24, 2024
1 parent f90283d commit 007a670
Show file tree
Hide file tree
Showing 18 changed files with 1,165 additions and 2,451 deletions.
6 changes: 2 additions & 4 deletions cmd/metrics-powerstore/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,9 @@ import (
tracer "github.com/dell/csm-metrics-powerstore/opentelemetry/tracers"
"github.com/sirupsen/logrus"

"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/metric/global"

"github.com/fsnotify/fsnotify"
"github.com/spf13/viper"
"go.opentelemetry.io/otel"
)

const (
Expand Down Expand Up @@ -113,7 +111,7 @@ func main() {

powerStoreSvc := &service.PowerStoreService{
MetricsWrapper: &service.MetricsWrapper{
Meter: global.Meter("powerstore"),
Meter: otel.Meter("powerstore"),
},
Logger: logger,
VolumeFinder: volumeFinder,
Expand Down
88 changes: 46 additions & 42 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/dell/csm-metrics-powerstore

go 1.23
go 1.23.0

toolchain go1.23.2

Expand All @@ -10,82 +10,86 @@ require (
github.com/fsnotify/fsnotify v1.8.0
github.com/golang/mock v1.6.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/viper v1.10.1
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.10.0
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/exporters/zipkin v1.7.0
go.opentelemetry.io/otel/metric v0.30.0
go.opentelemetry.io/otel/sdk v1.7.0
go.opentelemetry.io/otel/sdk/metric v0.30.0
go.opentelemetry.io/otel/trace v1.7.0
google.golang.org/grpc v1.67.1
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.31.3
k8s.io/apimachinery v0.31.3
k8s.io/client-go v0.31.3
go.opentelemetry.io/otel v1.33.0
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.33.0
go.opentelemetry.io/otel/exporters/zipkin v1.33.0
go.opentelemetry.io/otel/metric v1.33.0
go.opentelemetry.io/otel/sdk v1.33.0
go.opentelemetry.io/otel/sdk/metric v1.33.0
go.opentelemetry.io/otel/trace v1.33.0
google.golang.org/grpc v1.69.0
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.32.0
k8s.io/apimachinery v0.32.0
k8s.io/client-go v0.32.0
)

require (
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/errors v0.22.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonpointer v0.21.0 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/strfmt v0.23.0 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-openapi/swag v0.23.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/openzipkin/zipkin-go v0.4.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/openzipkin/zipkin-go v0.4.3 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.4.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.mongodb.org/mongo-driver v1.17.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.7.0 // indirect
go.opentelemetry.io/proto/otlp v0.16.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/oauth2 v0.22.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/term v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect
google.golang.org/protobuf v1.34.2 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/proto/otlp v1.4.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/net v0.32.0 // indirect
golang.org/x/oauth2 v0.24.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/time v0.7.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect
google.golang.org/protobuf v1.35.2 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.66.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)
Loading

0 comments on commit 007a670

Please sign in to comment.