diff --git a/cmd/collector/app/collector.go b/cmd/collector/app/collector.go index f7e783e06aa..599f81a9d99 100644 --- a/cmd/collector/app/collector.go +++ b/cmd/collector/app/collector.go @@ -16,9 +16,9 @@ import ( "github.com/jaegertracing/jaeger/cmd/collector/app/flags" "github.com/jaegertracing/jaeger/cmd/collector/app/handler" "github.com/jaegertracing/jaeger/cmd/collector/app/processor" - "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/samplingstrategy" "github.com/jaegertracing/jaeger/cmd/collector/app/server" "github.com/jaegertracing/jaeger/internal/safeexpvar" + "github.com/jaegertracing/jaeger/internal/sampling/samplingstrategy" "github.com/jaegertracing/jaeger/model" "github.com/jaegertracing/jaeger/pkg/healthcheck" "github.com/jaegertracing/jaeger/pkg/metrics" diff --git a/cmd/collector/app/server/grpc.go b/cmd/collector/app/server/grpc.go index 8e10e78bf6d..1234ba021e9 100644 --- a/cmd/collector/app/server/grpc.go +++ b/cmd/collector/app/server/grpc.go @@ -17,8 +17,8 @@ import ( "google.golang.org/grpc/reflection" "github.com/jaegertracing/jaeger/cmd/collector/app/handler" - "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/samplingstrategy" samplinggrpc "github.com/jaegertracing/jaeger/internal/sampling/grpc" + "github.com/jaegertracing/jaeger/internal/sampling/samplingstrategy" "github.com/jaegertracing/jaeger/pkg/telemetry" "github.com/jaegertracing/jaeger/proto-gen/api_v2" ) diff --git a/cmd/collector/app/server/http.go b/cmd/collector/app/server/http.go index bb12c6740ba..38be2fa69a8 100644 --- a/cmd/collector/app/server/http.go +++ b/cmd/collector/app/server/http.go @@ -14,8 +14,8 @@ import ( "go.uber.org/zap/zapcore" "github.com/jaegertracing/jaeger/cmd/collector/app/handler" - "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/samplingstrategy" samplinghttp "github.com/jaegertracing/jaeger/internal/sampling/http" + "github.com/jaegertracing/jaeger/internal/sampling/samplingstrategy" "github.com/jaegertracing/jaeger/pkg/healthcheck" "github.com/jaegertracing/jaeger/pkg/httpmetrics" "github.com/jaegertracing/jaeger/pkg/metrics" diff --git a/cmd/jaeger/internal/extension/remotesampling/extension.go b/cmd/jaeger/internal/extension/remotesampling/extension.go index b4d62d9d5a9..151211750f3 100644 --- a/cmd/jaeger/internal/extension/remotesampling/extension.go +++ b/cmd/jaeger/internal/extension/remotesampling/extension.go @@ -19,12 +19,12 @@ import ( "google.golang.org/grpc/health" "google.golang.org/grpc/health/grpc_health_v1" - "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/samplingstrategy" "github.com/jaegertracing/jaeger/cmd/jaeger/internal/extension/jaegerstorage" "github.com/jaegertracing/jaeger/internal/leaderelection" "github.com/jaegertracing/jaeger/internal/metrics/otelmetrics" samplinggrpc "github.com/jaegertracing/jaeger/internal/sampling/grpc" samplinghttp "github.com/jaegertracing/jaeger/internal/sampling/http" + "github.com/jaegertracing/jaeger/internal/sampling/samplingstrategy" "github.com/jaegertracing/jaeger/pkg/metrics" "github.com/jaegertracing/jaeger/plugin/sampling/strategyprovider/adaptive" "github.com/jaegertracing/jaeger/plugin/sampling/strategyprovider/static" diff --git a/cmd/jaeger/internal/processors/adaptivesampling/processor.go b/cmd/jaeger/internal/processors/adaptivesampling/processor.go index 6a42151b1da..de3f2cfae88 100644 --- a/cmd/jaeger/internal/processors/adaptivesampling/processor.go +++ b/cmd/jaeger/internal/processors/adaptivesampling/processor.go @@ -10,9 +10,9 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/pdata/ptrace" - "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/samplingstrategy" "github.com/jaegertracing/jaeger/cmd/jaeger/internal/extension/remotesampling" "github.com/jaegertracing/jaeger/internal/metrics/otelmetrics" + "github.com/jaegertracing/jaeger/internal/sampling/samplingstrategy" "github.com/jaegertracing/jaeger/plugin/sampling/strategyprovider/adaptive" "github.com/jaegertracing/jaeger/storage_v2/v1adapter" ) diff --git a/internal/sampling/grpc/grpc_handler.go b/internal/sampling/grpc/grpc_handler.go index be6cc64260f..f1ac4d0cac3 100644 --- a/internal/sampling/grpc/grpc_handler.go +++ b/internal/sampling/grpc/grpc_handler.go @@ -6,7 +6,7 @@ package grpc import ( "context" - "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/samplingstrategy" + "github.com/jaegertracing/jaeger/internal/sampling/samplingstrategy" "github.com/jaegertracing/jaeger/proto-gen/api_v2" ) diff --git a/internal/sampling/http/cfgmgr.go b/internal/sampling/http/cfgmgr.go index 7231185cfc1..16d733f7d9d 100644 --- a/internal/sampling/http/cfgmgr.go +++ b/internal/sampling/http/cfgmgr.go @@ -6,7 +6,7 @@ package http import ( "context" - "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/samplingstrategy" + "github.com/jaegertracing/jaeger/internal/sampling/samplingstrategy" "github.com/jaegertracing/jaeger/proto-gen/api_v2" ) diff --git a/cmd/collector/app/sampling/samplingstrategy/empty_test.go b/internal/sampling/samplingstrategy/empty_test.go similarity index 100% rename from cmd/collector/app/sampling/samplingstrategy/empty_test.go rename to internal/sampling/samplingstrategy/empty_test.go diff --git a/cmd/collector/app/sampling/samplingstrategy/factory.go b/internal/sampling/samplingstrategy/factory.go similarity index 100% rename from cmd/collector/app/sampling/samplingstrategy/factory.go rename to internal/sampling/samplingstrategy/factory.go diff --git a/cmd/collector/app/sampling/samplingstrategy/interface.go b/internal/sampling/samplingstrategy/interface.go similarity index 100% rename from cmd/collector/app/sampling/samplingstrategy/interface.go rename to internal/sampling/samplingstrategy/interface.go diff --git a/plugin/sampling/strategyprovider/adaptive/aggregator.go b/plugin/sampling/strategyprovider/adaptive/aggregator.go index 078a8bcb3f4..b48de796f52 100644 --- a/plugin/sampling/strategyprovider/adaptive/aggregator.go +++ b/plugin/sampling/strategyprovider/adaptive/aggregator.go @@ -9,8 +9,8 @@ import ( "go.uber.org/zap" - "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/samplingstrategy" "github.com/jaegertracing/jaeger/internal/leaderelection" + "github.com/jaegertracing/jaeger/internal/sampling/samplingstrategy" span_model "github.com/jaegertracing/jaeger/model" "github.com/jaegertracing/jaeger/pkg/hostname" "github.com/jaegertracing/jaeger/pkg/metrics" diff --git a/plugin/sampling/strategyprovider/adaptive/factory.go b/plugin/sampling/strategyprovider/adaptive/factory.go index 3b42c0249b4..578d6591973 100644 --- a/plugin/sampling/strategyprovider/adaptive/factory.go +++ b/plugin/sampling/strategyprovider/adaptive/factory.go @@ -10,8 +10,8 @@ import ( "github.com/spf13/viper" "go.uber.org/zap" - "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/samplingstrategy" "github.com/jaegertracing/jaeger/internal/leaderelection" + "github.com/jaegertracing/jaeger/internal/sampling/samplingstrategy" "github.com/jaegertracing/jaeger/pkg/distributedlock" "github.com/jaegertracing/jaeger/pkg/metrics" "github.com/jaegertracing/jaeger/plugin" diff --git a/plugin/sampling/strategyprovider/adaptive/factory_test.go b/plugin/sampling/strategyprovider/adaptive/factory_test.go index b008cc5fabb..409abd801fc 100644 --- a/plugin/sampling/strategyprovider/adaptive/factory_test.go +++ b/plugin/sampling/strategyprovider/adaptive/factory_test.go @@ -13,7 +13,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap" - ss "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/samplingstrategy" + "github.com/jaegertracing/jaeger/internal/sampling/samplingstrategy" "github.com/jaegertracing/jaeger/pkg/config" "github.com/jaegertracing/jaeger/pkg/distributedlock" lmocks "github.com/jaegertracing/jaeger/pkg/distributedlock/mocks" @@ -25,8 +25,8 @@ import ( ) var ( - _ ss.Factory = new(Factory) - _ plugin.Configurable = new(Factory) + _ samplingstrategy.Factory = new(Factory) + _ plugin.Configurable = new(Factory) ) func TestFactory(t *testing.T) { diff --git a/plugin/sampling/strategyprovider/factory.go b/plugin/sampling/strategyprovider/factory.go index 81c7104c3df..05fc222d07d 100644 --- a/plugin/sampling/strategyprovider/factory.go +++ b/plugin/sampling/strategyprovider/factory.go @@ -11,7 +11,7 @@ import ( "github.com/spf13/viper" "go.uber.org/zap" - "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/samplingstrategy" + "github.com/jaegertracing/jaeger/internal/sampling/samplingstrategy" "github.com/jaegertracing/jaeger/pkg/metrics" "github.com/jaegertracing/jaeger/plugin" "github.com/jaegertracing/jaeger/plugin/sampling/strategyprovider/adaptive" diff --git a/plugin/sampling/strategyprovider/factory_test.go b/plugin/sampling/strategyprovider/factory_test.go index 3cfa513cdcd..753a827e999 100644 --- a/plugin/sampling/strategyprovider/factory_test.go +++ b/plugin/sampling/strategyprovider/factory_test.go @@ -14,7 +14,7 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap" - ss "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/samplingstrategy" + "github.com/jaegertracing/jaeger/internal/sampling/samplingstrategy" "github.com/jaegertracing/jaeger/pkg/distributedlock" "github.com/jaegertracing/jaeger/pkg/metrics" "github.com/jaegertracing/jaeger/plugin" @@ -23,8 +23,8 @@ import ( ) var ( - _ ss.Factory = new(Factory) - _ plugin.Configurable = new(Factory) + _ samplingstrategy.Factory = new(Factory) + _ plugin.Configurable = new(Factory) ) func TestNewFactory(t *testing.T) { @@ -121,7 +121,7 @@ func (f *mockFactory) InitFromViper(v *viper.Viper, logger *zap.Logger) { f.logger = logger } -func (f *mockFactory) CreateStrategyProvider() (ss.Provider, ss.Aggregator, error) { +func (f *mockFactory) CreateStrategyProvider() (samplingstrategy.Provider, samplingstrategy.Aggregator, error) { if f.retError { return nil, nil, errors.New("error creating store") } diff --git a/plugin/sampling/strategyprovider/static/factory.go b/plugin/sampling/strategyprovider/static/factory.go index e19935649b9..3e5b2503da4 100644 --- a/plugin/sampling/strategyprovider/static/factory.go +++ b/plugin/sampling/strategyprovider/static/factory.go @@ -9,7 +9,7 @@ import ( "github.com/spf13/viper" "go.uber.org/zap" - "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/samplingstrategy" + "github.com/jaegertracing/jaeger/internal/sampling/samplingstrategy" "github.com/jaegertracing/jaeger/pkg/metrics" "github.com/jaegertracing/jaeger/plugin" "github.com/jaegertracing/jaeger/storage" diff --git a/plugin/sampling/strategyprovider/static/factory_test.go b/plugin/sampling/strategyprovider/static/factory_test.go index 8c7dd04834d..338722de474 100644 --- a/plugin/sampling/strategyprovider/static/factory_test.go +++ b/plugin/sampling/strategyprovider/static/factory_test.go @@ -9,15 +9,15 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/zap" - ss "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/samplingstrategy" + "github.com/jaegertracing/jaeger/internal/sampling/samplingstrategy" "github.com/jaegertracing/jaeger/pkg/config" "github.com/jaegertracing/jaeger/pkg/metrics" "github.com/jaegertracing/jaeger/plugin" ) var ( - _ ss.Factory = new(Factory) - _ plugin.Configurable = new(Factory) + _ samplingstrategy.Factory = new(Factory) + _ plugin.Configurable = new(Factory) ) func TestFactory(t *testing.T) { diff --git a/plugin/sampling/strategyprovider/static/provider.go b/plugin/sampling/strategyprovider/static/provider.go index 2ffd2a170f2..193b4459b94 100644 --- a/plugin/sampling/strategyprovider/static/provider.go +++ b/plugin/sampling/strategyprovider/static/provider.go @@ -18,7 +18,7 @@ import ( "go.uber.org/zap" - ss "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/samplingstrategy" + "github.com/jaegertracing/jaeger/internal/sampling/samplingstrategy" "github.com/jaegertracing/jaeger/proto-gen/api_v2" ) @@ -44,7 +44,7 @@ type storedStrategies struct { type strategyLoader func() ([]byte, error) // NewProvider creates a strategy store that holds static sampling strategies. -func NewProvider(options Options, logger *zap.Logger) (ss.Provider, error) { +func NewProvider(options Options, logger *zap.Logger) (samplingstrategy.Provider, error) { ctx, cancelFunc := context.WithCancel(context.Background()) h := &samplingProvider{ logger: logger,