Skip to content

Commit

Permalink
[receiver/jaegerreceiver] fix linting
Browse files Browse the repository at this point in the history
Signed-off-by: Benedikt Bongartz <[email protected]>
  • Loading branch information
frzifus committed Aug 31, 2023
1 parent 3982190 commit b3045aa
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 19 deletions.
1 change: 1 addition & 0 deletions receiver/jaegerreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ func createTracesReceiver(
cfg component.Config,
nextConsumer consumer.Traces,
) (receiver.Traces, error) {
logDeprecation(set.Logger)

// Convert settings in the source config to configuration struct
// that Jaeger receiver understands.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,17 @@ import (
"errors"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/jaegertracing/jaeger/thrift-gen/baggage"
"github.com/jaegertracing/jaeger/thrift-gen/sampling"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

type mockSamplingStore struct {
samplingResponse *sampling.SamplingStrategyResponse
}

func (m *mockSamplingStore) GetSamplingStrategy(_ context.Context, serviceName string) (*sampling.SamplingStrategyResponse, error) {
func (m *mockSamplingStore) GetSamplingStrategy(_ context.Context, _ string) (*sampling.SamplingStrategyResponse, error) {
if m.samplingResponse == nil {
return nil, errors.New("no mock response provided")
}
Expand All @@ -44,7 +43,7 @@ type mockBaggageMgr struct {
baggageResponse []*baggage.BaggageRestriction
}

func (m *mockBaggageMgr) GetBaggageRestrictions(_ context.Context, serviceName string) ([]*baggage.BaggageRestriction, error) {
func (m *mockBaggageMgr) GetBaggageRestrictions(_ context.Context, _ string) ([]*baggage.BaggageRestriction, error) {
if m.baggageResponse == nil {
return nil, errors.New("no mock response provided")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"strings"

"github.com/gorilla/mux"

"github.com/jaegertracing/jaeger/pkg/metrics"
tSampling "github.com/jaegertracing/jaeger/thrift-gen/sampling"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

// Autogenerated by Thrift Compiler (0.9.2) but manually adapted to 0.14.x

// nolint
package sampling // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver/internal/jaegerreceiverdeprecated/internal/clientcfghttp/thrift-0.9.2"

import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ import (
"context"
"errors"

"google.golang.org/grpc"

"github.com/jaegertracing/jaeger/model/converter/thrift/jaeger"
"github.com/jaegertracing/jaeger/proto-gen/api_v2"
"github.com/jaegertracing/jaeger/thrift-gen/baggage"
"github.com/jaegertracing/jaeger/thrift-gen/sampling"
"google.golang.org/grpc"
)

// SamplingManager returns sampling decisions from collector over gRPC.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type ManagerWithMetrics struct {
// WrapWithMetrics wraps ClientConfigManager and creates metrics for its invocations.
func WrapWithMetrics(manager ClientConfigManager, mFactory metrics.Factory) *ManagerWithMetrics {
m := configManagerMetrics{}
metrics.Init(&m, mFactory, nil)
_ = metrics.Init(&m, mFactory, nil)
return &ManagerWithMetrics{wrapped: manager, metrics: m}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ import (
"time"

"github.com/gorilla/mux"
"github.com/jaegertracing/jaeger/pkg/metrics"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"

"github.com/jaegertracing/jaeger/pkg/metrics"

"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver/internal/jaegerreceiverdeprecated/internal/clientcfghttp"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver/internal/jaegerreceiverdeprecated/internal/configmanager"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@ import (
"errors"
"testing"

"github.com/jaegertracing/jaeger/proto-gen/api_v2"
"github.com/jaegertracing/jaeger/thrift-gen/sampling"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/net/context"

"github.com/jaegertracing/jaeger/proto-gen/api_v2"
"github.com/jaegertracing/jaeger/thrift-gen/sampling"
)

type mockSamplingStore struct{}

func (s mockSamplingStore) GetSamplingStrategy(ctx context.Context, serviceName string) (*sampling.SamplingStrategyResponse, error) {
func (s mockSamplingStore) GetSamplingStrategy(_ context.Context, serviceName string) (*sampling.SamplingStrategyResponse, error) {
if serviceName == "error" {
return nil, errors.New("some error")
} else if serviceName == "nil" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
package strategystore // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver/internal/jaegerreceiverdeprecated/internal/sampling/strategystore"

import (
"go.uber.org/zap"

"github.com/jaegertracing/jaeger/pkg/metrics"
"github.com/jaegertracing/jaeger/storage"
"go.uber.org/zap"
)

// Factory defines an interface for a factory that can create implementations of different strategy storage components.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"github.com/jaegertracing/jaeger/thrift-gen/jaeger"
"github.com/jaegertracing/jaeger/thrift-gen/sampling"
"github.com/jaegertracing/jaeger/thrift-gen/zipkincore"

"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/config/configgrpc"
"go.opentelemetry.io/collector/config/confighttp"
Expand All @@ -37,7 +36,6 @@ import (
"google.golang.org/grpc"

jaegertranslator "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger"

"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver/internal/jaegerreceiverdeprecated/internal/configmanager"
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver/internal/jaegerreceiverdeprecated/internal/httpserver"
)
Expand Down

0 comments on commit b3045aa

Please sign in to comment.