Skip to content

Commit

Permalink
Disable OTel logs when creating new exporter
Browse files Browse the repository at this point in the history
Signed-off-by: odubajDT <[email protected]>
  • Loading branch information
odubajDT committed Oct 12, 2022
1 parent 0be89a5 commit 03ed4af
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions scheduler/cmd/scheduler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ package main
import (
"context"
"fmt"
"log"
"net"
"os"
"time"

"github.com/kelseyhightower/envconfig"
"go.opentelemetry.io/otel/exporters/otlp"
"go.opentelemetry.io/otel/exporters/otlp/otlpgrpc"
"google.golang.org/grpc"
"k8s.io/klog/v2"
"log"
"os"
"time"

"github.com/keptn-sandbox/lifecycle-controller/scheduler/pkg/klcpermit"
"k8s.io/apimachinery/pkg/util/rand"
Expand Down Expand Up @@ -125,6 +127,11 @@ func newOTelExporter(env envConfig) (sdktrace.SpanExporter, error) {
ctx, cancel := context.WithTimeout(context.TODO(), 3*time.Second)
defer cancel()

_, err := net.DialTimeout("tcp", env.OTelCollectorURL, 2*time.Second)
if err != nil {
return nil, err
}

driver := otlpgrpc.NewDriver(
otlpgrpc.WithInsecure(),
otlpgrpc.WithEndpoint(env.OTelCollectorURL),
Expand Down

0 comments on commit 03ed4af

Please sign in to comment.