this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'jake/add-otlptracehttp'

+8 -6
+8 -6
cmd/bigsky/main.go
··· 59 59 &cli.BoolFlag{ 60 60 Name: "jaeger", 61 61 }, 62 - &cli.BoolFlag{ 63 - Name: "otlp", 64 - EnvVars: []string{"OTLP_TRACE_HTTP"}, 65 - }, 66 62 &cli.StringFlag{ 67 63 Name: "db-url", 68 64 Usage: "database connection string for BGS database", ··· 137 133 138 134 otel.SetTracerProvider(tp) 139 135 } 140 - if cctx.Bool("oltp") { 136 + 137 + // Enable OTLP HTTP exporter 138 + // For relevant environment variables: 139 + // https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace#readme-environment-variables 140 + // At a minimum, you need to set 141 + // OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 142 + if os.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT") != "" { 141 143 ctx, cancel := context.WithCancel(context.Background()) 142 144 defer cancel() 143 145 144 - exp, err := otlptracehttp.New(ctx, otlptracehttp.WithInsecure()) 146 + exp, err := otlptracehttp.New(ctx) 145 147 if err != nil { 146 148 log.Fatalw("failed to create trace exporter", "error", err) 147 149 }