File tree 1 file changed +3
-16
lines changed
1 file changed +3
-16
lines changed Original file line number Diff line number Diff line change @@ -70,24 +70,11 @@ func run() error {
70
70
TracesSampleRate : 1.0 ,
71
71
// ... or a TracesSampler
72
72
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" {
78
75
return 0.0
79
76
}
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
+
91
78
return 1.0
92
79
}),
93
80
})
You can’t perform that action at this time.
0 commit comments