Update dependencies
This commit is contained in:
42
vendor/github.com/getsentry/sentry-go/hub.go
generated
vendored
42
vendor/github.com/getsentry/sentry-go/hub.go
generated
vendored
@@ -2,7 +2,6 @@ package sentry
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
@@ -294,13 +293,8 @@ func (hub *Hub) AddBreadcrumb(breadcrumb *Breadcrumb, hint *BreadcrumbHint) {
|
||||
}
|
||||
|
||||
max := client.options.MaxBreadcrumbs
|
||||
switch {
|
||||
case max < 0:
|
||||
if max < 0 {
|
||||
return
|
||||
case max == 0:
|
||||
max = defaultMaxBreadcrumbs
|
||||
case max > maxBreadcrumbs:
|
||||
max = maxBreadcrumbs
|
||||
}
|
||||
|
||||
if client.options.BeforeBreadcrumb != nil {
|
||||
@@ -313,6 +307,12 @@ func (hub *Hub) AddBreadcrumb(breadcrumb *Breadcrumb, hint *BreadcrumbHint) {
|
||||
}
|
||||
}
|
||||
|
||||
if max == 0 {
|
||||
max = defaultMaxBreadcrumbs
|
||||
} else if max > maxBreadcrumbs {
|
||||
max = maxBreadcrumbs
|
||||
}
|
||||
|
||||
hub.Scope().AddBreadcrumb(breadcrumb, max)
|
||||
}
|
||||
|
||||
@@ -365,34 +365,6 @@ func (hub *Hub) Flush(timeout time.Duration) bool {
|
||||
return client.Flush(timeout)
|
||||
}
|
||||
|
||||
// GetTraceparent returns the current Sentry traceparent string, to be used as a HTTP header value
|
||||
// or HTML meta tag value.
|
||||
// This function is context aware, as in it either returns the traceparent based
|
||||
// on the current span, or the scope's propagation context.
|
||||
func (hub *Hub) GetTraceparent() string {
|
||||
scope := hub.Scope()
|
||||
|
||||
if scope.span != nil {
|
||||
return scope.span.ToSentryTrace()
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%s-%s", scope.propagationContext.TraceID, scope.propagationContext.SpanID)
|
||||
}
|
||||
|
||||
// GetBaggage returns the current Sentry baggage string, to be used as a HTTP header value
|
||||
// or HTML meta tag value.
|
||||
// This function is context aware, as in it either returns the baggage based
|
||||
// on the current span or the scope's propagation context.
|
||||
func (hub *Hub) GetBaggage() string {
|
||||
scope := hub.Scope()
|
||||
|
||||
if scope.span != nil {
|
||||
return scope.span.ToBaggage()
|
||||
}
|
||||
|
||||
return scope.propagationContext.DynamicSamplingContext.String()
|
||||
}
|
||||
|
||||
// HasHubOnContext checks whether Hub instance is bound to a given Context struct.
|
||||
func HasHubOnContext(ctx context.Context) bool {
|
||||
_, ok := ctx.Value(HubContextKey).(*Hub)
|
||||
|
||||
Reference in New Issue
Block a user