Sentry Tracing Identifier
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package logging
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/getsentry/sentry-go"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
@ -36,3 +37,10 @@ func (hook *SentryHook) Levels() []logrus.Level {
|
||||
logrus.WarnLevel,
|
||||
}
|
||||
}
|
||||
|
||||
func StartSpan(op, description string, ctx context.Context, callback func(context.Context)) {
|
||||
span := sentry.StartSpan(ctx, op)
|
||||
span.Description = description
|
||||
defer span.Finish()
|
||||
callback(span.Context())
|
||||
}
|
||||
|
Reference in New Issue
Block a user