Skip to content

Commit cb8009a

Browse files
committed
Update _examples
1 parent 265459b commit cb8009a

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

_examples/http/main.go

+3-16
Original file line numberDiff line numberDiff line change
@@ -70,24 +70,11 @@ func run() error {
7070
TracesSampleRate: 1.0,
7171
// ... or a TracesSampler
7272
TracesSampler: sentry.TracesSampler(func(ctx sentry.SamplingContext) float64 {
73-
// As an example, this custom sampler does not send some
74-
// transactions to Sentry based on their name.
75-
hub := sentry.GetHubFromContext(ctx.Span.Context())
76-
name := hub.Scope().Transaction()
77-
if name == "GET /favicon.ico" {
73+
// Don't sample health checks.
74+
if ctx.Span.Name == "GET /health" {
7875
return 0.0
7976
}
80-
if strings.HasPrefix(name, "HEAD") {
81-
return 0.0
82-
}
83-
// As an example, sample some transactions with a uniform rate.
84-
if strings.HasPrefix(name, "POST") {
85-
return 0.2
86-
}
87-
// Sample all other transactions for testing. On
88-
// production, use TracesSampleRate with a rate adequate
89-
// for your traffic, or use the SamplingContext to
90-
// customize sampling per-transaction.
77+
9178
return 1.0
9279
}),
9380
})

0 commit comments

Comments
 (0)