Skip to content

Commit

Permalink
Add new Go config options (#7868)
Browse files Browse the repository at this point in the history
  • Loading branch information
cleptric authored Sep 20, 2023
1 parent 437295c commit 06da41f
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ sentry.Init(sentry.ClientOptions{
event.Message += " [example]"
return event
},
})
```
6 changes: 6 additions & 0 deletions src/platform-includes/configuration/ignore-errors/go.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```go
sentry.Init(sentry.ClientOptions{
// ...
IgnoreErrors: []string{"my-error", "error-*"},
})
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
```go
sentry.Init(sentry.ClientOptions{
// ...
IgnoreTransactions: []string{"/home", "/check-*"},
})
```
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```go
err := sentry.Init(sentry.ClientOptions{
sentry.Init(sentry.ClientOptions{
// ...
TracesSampler: sentry.TracesSampler(func(ctx sentry.SamplingContext) float64 {
if condition {
Expand Down
4 changes: 2 additions & 2 deletions src/platforms/common/configuration/filtering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ In this example, the fingerprint is forced to a common value if an exception of

</PlatformSection>

<PlatformSection supported={["javascript", "node"]} >
<PlatformSection supported={["javascript", "node", "go"]} >

### Using <PlatformIdentifier name="ignore-errors" />

Expand Down Expand Up @@ -120,7 +120,7 @@ Learn more about <PlatformLink to="/configuration/sampling/">configuring the sam

</PlatformSection>

<PlatformSection supported={["javascript", "node"]} >
<PlatformSection supported={["javascript", "node", "go"]} >

### Using <PlatformIdentifier name="ignore-transactions" />

Expand Down
6 changes: 6 additions & 0 deletions src/platforms/go/common/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,16 @@ type ClientOptions struct {
TracesSampleRate float64
// Used to customize the sampling of traces, overrides TracesSampleRate.
TracesSampler TracesSampler
// The sample rate for profiling traces in the range [0.0, 1.0].
// This is relative to TracesSampleRate - it is a ratio of profiled traces out of all sampled traces.
ProfilesSampleRate float64
// List of regexp strings that will be used to match against event's message
// and if applicable, caught errors type and value.
// If the match is found, then a whole event will be dropped.
IgnoreErrors []string
// List of regexp strings that will be used to match against a transaction's
// name. If a match is found, then the transaction will be dropped.
IgnoreTransactions []string
// If this flag is enabled, certain personally identifiable information (PII) is added by active integrations.
// By default, no such data is sent.
SendDefaultPII bool
Expand Down

1 comment on commit 06da41f

@vercel
Copy link

@vercel vercel bot commented on 06da41f Sep 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

sentry-docs – ./

sentry-docs-git-master.sentry.dev
docs.sentry.io
sentry-docs.sentry.dev

Please sign in to comment.