Add Fatalf to standard logger-ish
This commit is contained in:
@@ -64,7 +64,6 @@ type TracerConfig struct {
|
||||
}
|
||||
|
||||
func InitTracer(ctx context.Context, cfg *TracerConfig) (TpShutdownFunc, error) {
|
||||
// todo: setup environment from cfg
|
||||
return SetupSDK(ctx, cfg)
|
||||
}
|
||||
|
||||
@@ -72,6 +71,8 @@ func SetupSDK(ctx context.Context, cfg *TracerConfig) (shutdown TpShutdownFunc,
|
||||
|
||||
log := logger.Setup()
|
||||
|
||||
log.Warn("SetupSDK")
|
||||
|
||||
if serviceName := os.Getenv(svcNameKey); len(serviceName) == 0 {
|
||||
if len(cfg.ServiceName) > 0 {
|
||||
os.Setenv(svcNameKey, cfg.ServiceName)
|
||||
@@ -199,9 +200,11 @@ func newOLTPExporter(ctx context.Context, cfg *TracerConfig) (otelsdktrace.SpanE
|
||||
opts = append(opts, otlptracegrpc.WithTLSCredentials(credentials.NewTLS(tlsConfig)))
|
||||
}
|
||||
if len(cfg.Endpoint) > 0 {
|
||||
log.Info("adding option", "Endpoint", cfg.Endpoint)
|
||||
opts = append(opts, otlptracegrpc.WithEndpoint(cfg.Endpoint))
|
||||
}
|
||||
if len(cfg.EndpointURL) > 0 {
|
||||
log.Info("adding option", "EndpointURL", cfg.EndpointURL)
|
||||
opts = append(opts, otlptracegrpc.WithEndpointURL(cfg.EndpointURL))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user