Skip to content

Commit 0d1d66d

Browse files
ribicecleptric
andauthored
Add Integrations page for Go (#11360)
Co-authored-by: Michi Hoffmann <[email protected]>
1 parent acaf0d1 commit 0d1d66d

File tree

1 file changed

+63
-0
lines changed
  • docs/platforms/go/common/integrations

1 file changed

+63
-0
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: Integrations
3+
description: "Learn about the automatic integrations Sentry provides and how to configure them."
4+
sidebar_order: 500
5+
---
6+
7+
## Default Integrations
8+
9+
These integrations are enabled by default and integrate into the standard library or the Go runtime itself. They are documented so you can be aware of what they do and disable them if they cause issues.
10+
11+
To disable default integrations, you can provide an empty list of integrations when calling `sentry.Init()`.
12+
13+
```go
14+
sentry.Init(sentry.ClientOptions{
15+
Dsn: "https://[email protected]/0",
16+
Integrations: func(i []sentry.Integration) []sentry.Integration {
17+
return []sentry.Integration{}
18+
},
19+
})
20+
```
21+
22+
### ModulesIntegration
23+
24+
This integration records all Go modules used in your application, including the version, as part of event details.
25+
26+
### EnvironmentIntegration
27+
28+
This integration fills the event data with Go runtime and OS-level specific information, such as CPU core/thread count and runtime version.
29+
30+
### IgnoreErrorsIntegration
31+
32+
This integration allows you to ignore certain error patterns using regular expressions. It ensures that errors matching the specified patterns are not sent to Sentry.
33+
34+
### IgnoreTransactionsIntegration
35+
36+
This integration lets you ignore specific transactions that match the provided patterns. This is useful when certain transaction names should not be captured.
37+
38+
### ContextifyFramesIntegration
39+
40+
This integration captures context around lines of code that caused an error. It provides a snapshot of source code, including lines before and after the error, for better debugging.
41+
42+
### GlobalTagsIntegration
43+
44+
This integration adds global tags to all events. These can be defined as environment variables using the `SENTRY_TAGS_` prefix or within the client options.
45+
46+
### Disabling certain Integrations
47+
48+
You can customize the list of integrations without disabling all the default ones using the Integrations option. In the example below, all integrations are enabled except the ContextifyFrames Integration:
49+
50+
```go
51+
sentry.Init(sentry.ClientOptions{
52+
Integrations: func(integrations []sentry.Integration) []sentry.Integration {
53+
var filteredIntegrations []sentry.Integration
54+
for _, integration := range integrations {
55+
if integration.Name() == "ContextifyFrames" {
56+
continue
57+
}
58+
filteredIntegrations = append(filteredIntegrations, integration)
59+
}
60+
return filteredIntegrations
61+
},
62+
})
63+
```

0 commit comments

Comments
 (0)