Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: danish siddiqui <[email protected]>
  • Loading branch information
danish9039 committed Apr 7, 2024
1 parent 078f588 commit b498d4e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
7 changes: 6 additions & 1 deletion cmd/agent/app/configmanager/grpc/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package grpc
import (
"context"
"errors"
"fmt"

"google.golang.org/grpc"

Expand All @@ -38,7 +39,11 @@ func NewConfigManager(conn *grpc.ClientConn) *ConfigManagerProxy {

// GetSamplingStrategy returns sampling strategies from collector.
func (s *ConfigManagerProxy) GetSamplingStrategy(ctx context.Context, serviceName string) (*api_v2.SamplingStrategyResponse, error) {
return s.client.GetSamplingStrategy(ctx, &api_v2.SamplingStrategyParameters{ServiceName: serviceName})
resp, err := s.client.GetSamplingStrategy(ctx, &api_v2.SamplingStrategyParameters{ServiceName: serviceName})
if err != nil {
return nil, fmt.Errorf("our internal message/explanation: %w", err)
}
return resp, nil
}

// GetBaggageRestrictions returns baggage restrictions from collector.
Expand Down
2 changes: 1 addition & 1 deletion cmd/agent/app/configmanager/grpc/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestSamplingManager_GetSamplingStrategy_error(t *testing.T) {
resp, err := manager.GetSamplingStrategy(context.Background(), "any")
require.Nil(t, resp)
require.Error(t, err)
assert.Contains(t, err.Error(), "Error while dialing")
assert.Contains(t, err.Error(), "our internal message/explanation")
}

func TestSamplingManager_GetBaggageRestrictions(t *testing.T) {
Expand Down
1 change: 0 additions & 1 deletion cmd/agent/app/processors/thrift_processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ func createProcessor(t *testing.T, mFactory metrics.Factory, tFactory thrift.TPr
func initCollectorAndReporter(t *testing.T) (*metricstest.Factory, *testutils.GrpcCollector, reporter.Reporter, *grpc.ClientConn) {
grpcCollector := testutils.StartGRPCCollector(t)
conn, err := grpc.NewClient(grpcCollector.Listener().Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials()))
grpc.NewClient(grpcCollector.Listener().Addr().String(), grpc.WithTransportCredentials(insecure.NewCredentials()))
require.NoError(t, err)
rep := grpcrep.NewReporter(conn, map[string]string{}, zaptest.NewLogger(t))
metricsFactory := metricstest.NewFactory(0)
Expand Down
2 changes: 1 addition & 1 deletion proto-gen/api_v2/sampling.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b498d4e

Please sign in to comment.