Skip to content

Commit

Permalink
pkg/routine: Drop spans
Browse files Browse the repository at this point in the history
  • Loading branch information
monstermunchkin committed Nov 27, 2024
1 parent 4597413 commit 3f0f1e9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
6 changes: 0 additions & 6 deletions pkg/routine/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"fmt"
"time"

"github.com/getsentry/sentry-go"
"github.com/pace/bricks/maintenance/errors"
"github.com/pace/bricks/pkg/lock/redis"

Expand Down Expand Up @@ -58,11 +57,6 @@ func (r *routineThatKeepsRunningOneInstance) Run(ctx context.Context) {
// until it returns. Return the backoff duration after which another single run
// should be performed.
func (r *routineThatKeepsRunningOneInstance) singleRun(ctx context.Context) time.Duration {
span := sentry.StartSpan(ctx, "function", sentry.WithDescription(fmt.Sprintf("Routine %s", r.Name)))
defer span.Finish()

ctx = span.Context()

l := redis.NewLock("routine:lock:"+r.Name, redis.SetTTL(r.lockTTL))
lockCtx, cancel, err := l.AcquireAndKeepUp(ctx)
if err != nil {
Expand Down
7 changes: 0 additions & 7 deletions pkg/routine/routine.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import (
"sync/atomic"
"syscall"

"github.com/getsentry/sentry-go"

"github.com/pace/bricks/maintenance/errors"
"github.com/pace/bricks/maintenance/log"
pkgcontext "github.com/pace/bricks/pkg/context"
Expand Down Expand Up @@ -94,11 +92,6 @@ func Run(parentCtx context.Context, routine func(context.Context)) (cancel conte
// add routine number to context and logger
num := atomic.AddInt64(&ctr, 1)

span := sentry.StartTransaction(ctx, fmt.Sprintf("Routine %d", num), sentry.WithOpName("function"))
defer span.Finish()

ctx = span.Context()

ctx = context.WithValue(ctx, ctxNumKey{}, num)
logger := log.Ctx(ctx).With().Int64("routine", num).Logger()
ctx = logger.WithContext(ctx)
Expand Down

0 comments on commit 3f0f1e9

Please sign in to comment.