Skip to content

Commit

Permalink
refactor: using tracer.StartSpan
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed May 22, 2022
1 parent 99c4e81 commit 6076946
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions cmd/notifier/notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
repositoryStore "github.com/ViBiOh/ketchup/pkg/store/repository"
userStore "github.com/ViBiOh/ketchup/pkg/store/user"
mailer "github.com/ViBiOh/mailer/pkg/client"
"go.opentelemetry.io/otel/trace"
)

func main() {
Expand Down Expand Up @@ -69,12 +68,8 @@ func main() {

logger.Info("Starting notifier...")

ctx := context.Background()
if tracer := tracerApp.GetTracer("notifier"); tracer != nil {
var span trace.Span
ctx, span = tracer.Start(ctx, "notifier")
defer span.End()
}
ctx, end := tracer.StartSpan(context.Background(), tracerApp.GetTracer("notifier"), "notifier")
defer end()

switch *notificationType {
case "daily":
Expand Down

0 comments on commit 6076946

Please sign in to comment.