Skip to content

Commit

Permalink
chore: removing unused metricsCfg references
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Wogan <[email protected]>
  • Loading branch information
zorocloud committed Jun 12, 2024
1 parent 0578ef2 commit 5eb7683
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion interceptor/metrics/metricscollector.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func NewMetricsCollectors(metricsConfig *config.Metrics) {
}

if metricsConfig.OtelHTTPExporterEnabled {
otelhttpmetrics := NewOtelMetrics(metricsConfig)
otelhttpmetrics := NewOtelMetrics()
collectors = append(collectors, otelhttpmetrics)
}
}
Expand Down
3 changes: 1 addition & 2 deletions interceptor/metrics/otelmetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"go.opentelemetry.io/otel/sdk/resource"
semconv "go.opentelemetry.io/otel/semconv/v1.4.0"

"github.com/kedacore/http-add-on/interceptor/config"
"github.com/kedacore/http-add-on/pkg/build"
)

Expand All @@ -21,7 +20,7 @@ type OtelMetrics struct {
pendingRequestCounter api.Int64UpDownCounter
}

func NewOtelMetrics(metricsConfig *config.Metrics, options ...metric.Option) *OtelMetrics {
func NewOtelMetrics(options ...metric.Option) *OtelMetrics {
ctx := context.Background()

exporter, err := otlpmetrichttp.New(ctx)
Expand Down
5 changes: 1 addition & 4 deletions interceptor/metrics/otelmetrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import (
"github.com/stretchr/testify/assert"
"go.opentelemetry.io/otel/sdk/metric"
"go.opentelemetry.io/otel/sdk/metric/metricdata"

"github.com/kedacore/http-add-on/interceptor/config"
)

var (
Expand All @@ -19,8 +17,7 @@ var (
func init() {
testReader = metric.NewManualReader()
options := metric.WithReader(testReader)
metricsCfg := config.Metrics{}
testOtel = NewOtelMetrics(&metricsCfg, options)
testOtel = NewOtelMetrics(options)
}

func TestRequestCounter(t *testing.T) {
Expand Down

0 comments on commit 5eb7683

Please sign in to comment.