diff --git a/go.mod b/go.mod index 2e92993..85d54e1 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module go.sour.is/pkg -go 1.20 +go 1.21 require ( github.com/99designs/gqlgen v0.17.34 diff --git a/lg/tracer.go b/lg/tracer.go index 6f43764..99b0190 100644 --- a/lg/tracer.go +++ b/lg/tracer.go @@ -71,7 +71,7 @@ func (w wrapSpan) AddEvent(name string, options ...trace.EventOption) { args[2*i+1] = a.Value } - slog.Info(name, args...) + slog.Debug(name, args...) } func (w wrapSpan) RecordError(err error, options ...trace.EventOption) { @@ -142,7 +142,7 @@ func initTracing(ctx context.Context, name string) (context.Context, func() erro return ctx, nil } - exporterAddr := env.Default("EV_TRACE_ENDPOINT", "") + exporterAddr := env.Default("TRACE_ENDPOINT", "") if exporterAddr == "" { return ctx, nil } diff --git a/service/service.go b/service/service.go index b6ae9c8..b891b82 100644 --- a/service/service.go +++ b/service/service.go @@ -93,7 +93,7 @@ func (s *Harness) Run(ctx context.Context, appName, version string) error { span.End() } - g, _ := errgroup.WithContext(ctx) + g, ctx := errgroup.WithContext(ctx) g.Go(func() error { <-ctx.Done() // shutdown jobs @@ -111,7 +111,10 @@ func (s *Harness) Run(ctx context.Context, appName, version string) error { close(s.onRunning) err := g.Wait() + if err != nil { + log.Printf("Shutdown due to error: %s", err) + } return err }