Skip to content

Commit

Permalink
Made suggested changes
Browse files Browse the repository at this point in the history
Signed-off-by: Wise-Wizard <[email protected]>
  • Loading branch information
Wise-Wizard committed Jun 24, 2024
1 parent 33d5855 commit 4e7dcbb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
6 changes: 1 addition & 5 deletions internal/metrics/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

"github.com/prometheus/client_golang/prometheus"
"go.opentelemetry.io/otel/sdk/metric"
"go.opentelemetry.io/otel/sdk/resource"

"github.com/jaegertracing/jaeger/internal/metrics/otelmetrics"
prom "github.com/jaegertracing/jaeger/internal/metrics/prometheus"
Expand All @@ -33,10 +32,7 @@ func BenchmarkPrometheusCounter(b *testing.B) {
}

func BenchmarkOTELCounter(b *testing.B) {
res := resource.NewWithAttributes(
resource.Default().SchemaURL(),
)
meterProvider := metric.NewMeterProvider(metric.WithResource(res))
meterProvider := metric.NewMeterProvider()
factory := otelmetrics.NewFactory(meterProvider)
benchmarkCounter(b, factory)
}
7 changes: 2 additions & 5 deletions internal/metrics/otelmetrics/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,17 @@ import (
"log"

"github.com/jaegertracing/jaeger/pkg/metrics"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
metric "go.opentelemetry.io/otel/metric"
sdkmetric "go.opentelemetry.io/otel/sdk/metric"
)

type otelFactory struct {
meter metric.Meter
}

func NewFactory(meterProvider *sdkmetric.MeterProvider) metrics.Factory {
otel.SetMeterProvider(meterProvider)
func NewFactory(meterProvider metric.MeterProvider) metrics.Factory {
return &otelFactory{
meter: otel.Meter("jaeger-V2"),
meter: meterProvider.Meter("jaeger-v2"),
}
}

Expand Down

0 comments on commit 4e7dcbb

Please sign in to comment.