Skip to content

Commit

Permalink
[surfacers.otel] Fix a bug in exporter configuration logic. (cloudpro…
Browse files Browse the repository at this point in the history
  • Loading branch information
manugarg committed Dec 19, 2023
1 parent 330f1d3 commit be62d09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions surfacers/internal/otel/otel.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func getExporter(ctx context.Context, config *configpb.SurfacerConf, l *logger.L

var opts []otlpmetrichttp.Option

if expConf.GetEndpointUrl() == "" {
if expConf.GetEndpointUrl() != "" {
u, err := url.Parse(expConf.GetEndpointUrl())
if err != nil {
return nil, fmt.Errorf("invalid http endpoint_url: %s, err: %v", expConf.GetEndpointUrl(), err)
Expand Down Expand Up @@ -107,7 +107,7 @@ func getExporter(ctx context.Context, config *configpb.SurfacerConf, l *logger.L

var opts []otlpmetricgrpc.Option

if expConf.GetEndpoint() == "" {
if expConf.GetEndpoint() != "" {
opts = append(opts, otlpmetricgrpc.WithEndpoint(expConf.GetEndpoint()))
}

Expand Down

0 comments on commit be62d09

Please sign in to comment.