Skip to content

Commit

Permalink
Improved if condition
Browse files Browse the repository at this point in the history
Signed-off-by: Alok Kumar Singh <[email protected]>
  • Loading branch information
akstron committed Nov 11, 2024
1 parent 58d01b2 commit c65b4be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/jtracer/jtracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func otelResource(ctx context.Context, svc string) (*resource.Resource, error) {

func defaultGRPCOptions() []otlptracegrpc.Option {
var options []otlptracegrpc.Option
if strings.ToLower(os.Getenv("OTEL_EXPORTER_OTLP_INSECURE")) == "true" {
if !(strings.HasPrefix(os.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT"), "https://") || strings.ToLower(os.Getenv("OTEL_EXPORTER_OTLP_INSECURE")) == "false") {
options = append(options, otlptracegrpc.WithInsecure())
}
return options
Expand Down

0 comments on commit c65b4be

Please sign in to comment.