diff --git a/docs/platforms/go/common/troubleshooting.mdx b/docs/platforms/go/common/troubleshooting.mdx index 9670b2100e537..751430f9d413f 100644 --- a/docs/platforms/go/common/troubleshooting.mdx +++ b/docs/platforms/go/common/troubleshooting.mdx @@ -10,7 +10,6 @@ supported: - go.gin - go.http - go.iris - - go.martini - go.negroni --- diff --git a/docs/platforms/go/guides/martini/index.mdx b/docs/platforms/go/guides/martini/index.mdx deleted file mode 100644 index f1c2df72ba19d..0000000000000 --- a/docs/platforms/go/guides/martini/index.mdx +++ /dev/null @@ -1,140 +0,0 @@ ---- -title: Martini -description: "Learn how to use the Martini framework with Sentry." ---- - -For a quick reference, there is a [complete example](https://github.com/getsentry/sentry-go/tree/master/_examples/martini) at the Go SDK source code repository. - -[Go Dev-style API documentation](https://pkg.go.dev/github.com/getsentry/sentry-go/martini) is also available. - -## Features - -In addition to capturing errors, you can monitor interactions between multiple services or applications by [enabling tracing](/concepts/key-terms/tracing/). - -Select which Sentry features you'd like to install in addition to Error Monitoring to get the corresponding installation and configuration instructions below. - -## Install - - - -```bash -go get github.com/getsentry/sentry-go/martini -``` - - - - -```go {"onboardingOptions": {"performance": "12-16"}} -import ( - "fmt" - - "github.com/getsentry/sentry-go" - sentrymartini "github.com/getsentry/sentry-go/martini" - "github.com/go-martini/martini" -) - -// To initialize Sentry's handler, you need to initialize Sentry itself beforehand -if err := sentry.Init(sentry.ClientOptions{ - Dsn: "___PUBLIC_DSN___", - EnableTracing: true, - // Set TracesSampleRate to 1.0 to capture 100% - // of transactions for tracing. - // We recommend adjusting this value in production, - TracesSampleRate: 1.0, -}); err != nil { - fmt.Printf("Sentry initialization failed: %v\n", err) -} - -// Then create your app -app := martini.Classic() - -// Once it's done, you can attach the handler as one of your middleware -app.Use(sentrymartini.New(sentrymartini.Options{})) - -// Set up routes -app.Get("/", func() string { - return "Hello world!" -}) - -// And run it -app.Run() -``` - -## Configure - -`sentrymartini` accepts a struct of `Options` that allows you to configure how the handler will behave. - -Currently it respects 3 options: - -```go -// Whether Sentry should repanic after recovery, in most cases it should be set to true, -// as martini.Classic includes its own Recovery middleware that handles http responses. -Repanic bool -// Whether you want to block the request before moving forward with the response. -// Because Martini's default `Recovery` handler doesn't restart the application, -// it's safe to either skip this option or set it to `false`. -WaitForDelivery bool -// Timeout for the event delivery requests. -Timeout time.Duration -``` - -## Usage - -`sentrymartini` maps an instance of `*sentry.Hub` (https://pkg.go.dev/github.com/getsentry/sentry-go#Hub) as one of the services available throughout the rest of the request's lifetime. -You can access it by providing a `hub *sentry.Hub` parameter in any of your proceeding middleware and routes. -And it should be used instead of the global `sentry.CaptureMessage`, `sentry.CaptureException`, or any other calls, as it keeps the separation of data between the requests. - -**Keep in mind that `*sentry.Hub` won't be available in middleware attached before `sentrymartini`!** - -```go -app := martini.Classic() - -app.Use(sentrymartini.New(sentrymartini.Options{ - Repanic: true, -})) - -app.Use(func(rw http.ResponseWriter, r *http.Request, c martini.Context, hub *sentry.Hub) { - hub.Scope().SetTag("someRandomTag", "maybeYouNeedIt") -}) - -app.Get("/", func(rw http.ResponseWriter, r *http.Request, hub *sentry.Hub) { - if someCondition { - hub.WithScope(func (scope *sentry.Scope) { - scope.SetExtra("unwantedQuery", rw.URL.RawQuery) - hub.CaptureMessage("User provided unwanted query string, but we recovered just fine") - }) - } - rw.WriteHeader(http.StatusOK) -}) - -app.Get("/foo", func() string { - // sentrymartini handler will catch it just fine. Also, because we attached "someRandomTag" - // in the middleware before, it will be sent through as well - panic("y tho") -}) - -app.Run() -``` - -### Accessing Request in `BeforeSend` callback - - -```go -sentry.Init(sentry.ClientOptions{ - Dsn: "___PUBLIC_DSN___", - BeforeSend: func(event *sentry.Event, hint *sentry.EventHint) *sentry.Event { - if hint.Context != nil { - if req, ok := hint.Context.Value(sentry.RequestContextKey).(*http.Request); ok { - // You have access to the original Request here - } - } - - return event - }, -}) -``` diff --git a/docs/product/performance/getting-started.mdx b/docs/product/performance/getting-started.mdx index 7ebacb18b40a1..3434e382de758 100644 --- a/docs/product/performance/getting-started.mdx +++ b/docs/product/performance/getting-started.mdx @@ -19,7 +19,6 @@ If you don't already have performance monitoring enabled, use the links for supp - [FastHTTP](/platforms/go/guides/fasthttp/tracing/) - [Gin](/platforms/go/guides/gin/tracing/) - [Iris](/platforms/go/guides/iris/tracing/) - - [Martini](/platforms/go/guides/martini/tracing/) - [Negroni](/platforms/go/guides/negroni/tracing/) - [net/http](/platforms/go/guides/http/tracing/) - [OpenTelemetry](/platforms/go/tracing/instrumentation/opentelemetry/) diff --git a/src/components/platformIcon.tsx b/src/components/platformIcon.tsx index 99ec8fd3d2668..a5a88da9d50f0 100644 --- a/src/components/platformIcon.tsx +++ b/src/components/platformIcon.tsx @@ -81,7 +81,6 @@ import LaravelSVG from 'platformicons/svg/laravel.svg'; import LinuxSVG from 'platformicons/svg/linux.svg'; import LogbackSVG from 'platformicons/svg/logback.svg'; import LoguruSVG from 'platformicons/svg/loguru.svg'; -import MartiniSVG from 'platformicons/svg/martini.svg'; import MauiSVG from 'platformicons/svg/maui.svg'; import MongodbSVG from 'platformicons/svg/mongodb.svg'; import NativecSVG from 'platformicons/svg/nativec.svg'; @@ -217,7 +216,6 @@ import LaravelSVGLarge from 'platformicons/svg_80x80/laravel.svg'; import LinuxSVGLarge from 'platformicons/svg_80x80/linux.svg'; import LogbackSVGLarge from 'platformicons/svg_80x80/logback.svg'; import LoguruSVGLarge from 'platformicons/svg_80x80/loguru.svg'; -import MartiniSVGLarge from 'platformicons/svg_80x80/martini.svg'; import MauiSVGLarge from 'platformicons/svg_80x80/maui.svg'; import MongodbSVGLarge from 'platformicons/svg_80x80/mongodb.svg'; import NativecSVGLarge from 'platformicons/svg_80x80/nativec.svg'; @@ -601,10 +599,6 @@ const formatToSVG = { sm: LoguruSVG, lg: LoguruSVGLarge, }, - martini: { - sm: MartiniSVG, - lg: MartiniSVGLarge, - }, maui: { sm: MauiSVG, lg: MauiSVGLarge, @@ -862,7 +856,6 @@ export const PLATFORM_TO_ICON = { 'go-fasthttp': 'fasthttp', 'go-gin': 'gin', 'go-iris': 'iris', - 'go-martini': 'martini', 'go-negroni': 'go', 'go-logrus': 'go', godot: 'godot', diff --git a/src/middleware.ts b/src/middleware.ts index 3f25be55aecc7..2e120154bde48 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -209,10 +209,6 @@ const USER_DOCS_REDIRECTS: Redirect[] = [ from: '/platforms/go/serverless/', to: '/platforms/go/usage/serverless/', }, - { - from: '/platforms/go/martini/', - to: '/platforms/go/guides/martini/', - }, { from: '/platforms/go/fasthttp/', to: '/platforms/go/guides/fasthttp/',