Skip to content

Commit c6a8d8e

Browse files
authored
refactor: migrate Golang and related guides to inline product options syntax (#13413)
1 parent 085abf5 commit c6a8d8e

File tree

10 files changed

+53
-51
lines changed

10 files changed

+53
-51
lines changed

docs/platforms/go/guides/echo/index.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ go get github.com/getsentry/sentry-go/echo
2929
<Break />
3030

3131

32-
```go {"onboardingOptions": {"performance": "14-17"}}
32+
```go
3333
import (
3434
"fmt"
3535
"net/http"
@@ -43,13 +43,15 @@ import (
4343
// To initialize Sentry's handler, you need to initialize Sentry itself beforehand
4444
if err := sentry.Init(sentry.ClientOptions{
4545
Dsn: "___PUBLIC_DSN___",
46+
// ___PRODUCT_OPTION_START___ performance
4647
// Set TracesSampleRate to 1.0 to capture 100%
4748
// of transactions for tracing.
4849
// We recommend adjusting this value in production,
4950
TracesSampleRate: 1.0,
50-
// Adds request headers and IP for users,
51-
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
52-
SendDefaultPII: true,
51+
// ___PRODUCT_OPTION_END___ performance
52+
// Adds request headers and IP for users,
53+
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
54+
SendDefaultPII: true,
5355
}); err != nil {
5456
fmt.Printf("Sentry initialization failed: %v\n", err)
5557
}

docs/platforms/go/guides/fasthttp/index.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ go get github.com/getsentry/sentry-go/fasthttp
2929
<Break />
3030

3131

32-
```go {"onboardingOptions": {"performance": "12-16"}}
32+
```go
3333
import (
3434
"fmt"
3535
"net/http"
@@ -41,14 +41,16 @@ import (
4141
// To initialize Sentry's handler, you need to initialize Sentry itself beforehand
4242
if err := sentry.Init(sentry.ClientOptions{
4343
Dsn: "___PUBLIC_DSN___",
44+
// ___PRODUCT_OPTION_START___ performance
4445
EnableTracing: true,
4546
// Set TracesSampleRate to 1.0 to capture 100%
4647
// of transactions for tracing.
4748
// We recommend adjusting this value in production,
4849
TracesSampleRate: 1.0,
49-
// Adds request headers and IP for users,
50-
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
51-
SendDefaultPII: true,
50+
// ___PRODUCT_OPTION_END___ performance
51+
// Adds request headers and IP for users,
52+
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
53+
SendDefaultPII: true,
5254
}); err != nil {
5355
fmt.Printf("Sentry initialization failed: %v\n", err)
5456
}

docs/platforms/go/guides/fiber/index.mdx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ documentation](https://godoc.org/github.com/getsentry/sentry-go/fiber).
1212

1313
## Install
1414

15+
<OnboardingOptionButtons
16+
options={[
17+
'error-monitoring',
18+
'performance',
19+
]}
20+
/>
21+
1522
```shell
1623
go get github.com/getsentry/sentry-go/fiber
1724
```
@@ -30,14 +37,16 @@ import (
3037
// To initialize Sentry's handler, you need to initialize Sentry itself beforehand
3138
if err := sentry.Init(sentry.ClientOptions{
3239
Dsn: "___PUBLIC_DSN___",
40+
// ___PRODUCT_OPTION_START___ performance
3341
EnableTracing: true,
3442
// Set TracesSampleRate to 1.0 to capture 100%
3543
// of transactions for performance monitoring.
3644
// We recommend adjusting this value in production,
3745
TracesSampleRate: 1.0,
38-
// Adds request headers and IP for users,
39-
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
40-
SendDefaultPII: true,
46+
// ___PRODUCT_OPTION_END___ performance
47+
// Adds request headers and IP for users,
48+
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
49+
SendDefaultPII: true,
4150
}); err != nil {
4251
fmt.Printf("Sentry initialization failed: %v\n", err)
4352
}

docs/platforms/go/guides/gin/index.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ go get github.com/getsentry/sentry-go/gin
2929
<Break />
3030

3131

32-
```go {"onboardingOptions": {"performance": "13-17"}}
32+
```go
3333
import (
3434
"fmt"
3535
"net/http"
@@ -42,14 +42,16 @@ import (
4242
// To initialize Sentry's handler, you need to initialize Sentry itself beforehand
4343
if err := sentry.Init(sentry.ClientOptions{
4444
Dsn: "___PUBLIC_DSN___",
45+
// ___PRODUCT_OPTION_START___ performance
4546
EnableTracing: true,
4647
// Set TracesSampleRate to 1.0 to capture 100%
4748
// of transactions for tracing.
4849
// We recommend adjusting this value in production,
4950
TracesSampleRate: 1.0,
50-
// Adds request headers and IP for users,
51-
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
52-
SendDefaultPII: true,
51+
// ___PRODUCT_OPTION_END___ performance
52+
// Adds request headers and IP for users,
53+
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
54+
SendDefaultPII: true,
5355
}); err != nil {
5456
fmt.Printf("Sentry initialization failed: %v\n", err)
5557
}

docs/platforms/go/guides/http/index.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ go get github.com/getsentry/sentry-go/http
2929
<Break />
3030

3131

32-
```go {"onboardingOptions": {"performance": "12-16"}}
32+
```go
3333
import (
3434
"fmt"
3535
"net/http"
@@ -41,14 +41,16 @@ import (
4141
// To initialize Sentry's handler, you need to initialize Sentry itself beforehand
4242
if err := sentry.Init(sentry.ClientOptions{
4343
Dsn: "___PUBLIC_DSN___",
44+
// ___PRODUCT_OPTION_START___ performance
4445
EnableTracing: true,
4546
// Set TracesSampleRate to 1.0 to capture 100%
4647
// of transactions for tracing.
4748
// We recommend adjusting this value in production,
4849
TracesSampleRate: 1.0,
49-
// Adds request headers and IP for users,
50-
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
51-
SendDefaultPII: true,
50+
// ___PRODUCT_OPTION_END___ performance
51+
// Adds request headers and IP for users,
52+
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
53+
SendDefaultPII: true,
5254
}); err != nil {
5355
fmt.Printf("Sentry initialization failed: %v\n", err)
5456
}

docs/platforms/go/guides/iris/index.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ go get github.com/getsentry/sentry-go/iris
2929
<Break />
3030

3131

32-
```go {"onboardingOptions": {"performance": "12-16"}}
32+
```go
3333
import (
3434
"fmt"
3535

@@ -41,14 +41,16 @@ import (
4141
// To initialize Sentry's handler, you need to initialize Sentry itself beforehand
4242
if err := sentry.Init(sentry.ClientOptions{
4343
Dsn: "___PUBLIC_DSN___",
44+
// ___PRODUCT_OPTION_START___ performance
4445
EnableTracing: true,
4546
// Set TracesSampleRate to 1.0 to capture 100%
4647
// of transactions for tracing.
4748
// We recommend adjusting this value in production,
4849
TracesSampleRate: 1.0,
49-
// Adds request headers and IP for users,
50-
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
51-
SendDefaultPII: true,
50+
// ___PRODUCT_OPTION_END___ performance
51+
// Adds request headers and IP for users,
52+
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
53+
SendDefaultPII: true,
5254
}); err != nil {
5355
fmt.Printf("Sentry initialization failed: %v\n", err)
5456
}

docs/platforms/go/guides/logrus/index.mdx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ Go API documentation for the [`sentrylogrus` package](https://pkg.go.dev/github.
99

1010
## Install
1111

12-
<OnboardingOptionButtons
13-
options={[
14-
'error-monitoring',
15-
]}
16-
/>
17-
1812
```bash
1913
go get github.com/getsentry/sentry-go/logrus
2014
```
@@ -23,7 +17,7 @@ go get github.com/getsentry/sentry-go/logrus
2317

2418
<SignInNote />
2519

26-
```go {"onboardingOptions": {"performance": "14-17"}}
20+
```go
2721
import (
2822
"fmt"
2923
"net/http"
@@ -89,4 +83,3 @@ import (
8983
## Usage
9084

9185
Use `logrus` as you normally would, and it will automatically send logs at or above the specified levels to Sentry.
92-

docs/platforms/go/guides/negroni/index.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ go get github.com/getsentry/sentry-go/negroni
2929
<Break />
3030

3131

32-
```go {"onboardingOptions": {"performance": "13-17"}}
32+
```go
3333
import (
3434
"fmt"
3535
"net/http"
@@ -42,14 +42,16 @@ import (
4242
// To initialize Sentry's handler, you need to initialize Sentry itself beforehand
4343
if err := sentry.Init(sentry.ClientOptions{
4444
Dsn: "___PUBLIC_DSN___",
45+
// ___PRODUCT_OPTION_START___ performance
4546
EnableTracing: true,
4647
// Set TracesSampleRate to 1.0 to capture 100%
4748
// of transactions for tracing.
4849
// We recommend adjusting this value in production,
4950
TracesSampleRate: 1.0,
51+
// ___PRODUCT_OPTION_END___ performance
5052
// Adds request headers and IP for users,
51-
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
52-
SendDefaultPII: true,
53+
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
54+
SendDefaultPII: true,
5355
}); err != nil {
5456
fmt.Printf("Sentry initialization failed: %v\n", err)
5557
}

docs/platforms/go/guides/slog/index.mdx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ Go API documentation for the [`sentryslog` package](https://pkg.go.dev/github.co
99

1010
## Install
1111

12-
<OnboardingOptionButtons
13-
options={[
14-
'error-monitoring',
15-
]}
16-
/>
17-
1812
```bash
1913
go get github.com/getsentry/sentry-go/slog
2014
```
@@ -43,8 +37,8 @@ func main() {
4337
Dsn: "___PUBLIC_DSN___",
4438
EnableTracing: false,
4539
// Adds request headers and IP for users,
46-
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
47-
SendDefaultPII: true,
40+
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
41+
SendDefaultPII: true,
4842
})
4943
if err != nil {
5044
log.Fatal(err)

docs/platforms/go/guides/zerolog/index.mdx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ For a complete example, visit the [Go SDK source code repository](https://github
99

1010
## Install
1111

12-
<OnboardingOptionButtons
13-
options={[
14-
'error-monitoring',
15-
]}
16-
/>
17-
1812
```bash
1913
go get github.com/getsentry/sentry-go/zerolog
2014
```
@@ -26,7 +20,7 @@ go get github.com/getsentry/sentry-go/zerolog
2620
To integrate Sentry with Zerolog, you need to set up a custom writer that sends logs to Sentry based on the configured levels.
2721

2822

29-
```go {"onboardingOptions": {"performance": "12-16"}}
23+
```go
3024
import (
3125
"errors"
3226
"time"
@@ -43,8 +37,8 @@ func main() {
4337
err := sentry.Init(sentry.ClientOptions{
4438
Dsn: "___PUBLIC_DSN___",
4539
// Adds request headers and IP for users,
46-
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
47-
SendDefaultPII: true,
40+
// visit: https://docs.sentry.io/platforms/go/data-management/data-collected/ for more info
41+
SendDefaultPII: true,
4842
BeforeSend: func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event {
4943
// Modify or filter events before sending them to Sentry
5044
return event

0 commit comments

Comments
 (0)