proxy: Stop depending on the Sentry SDK

Summary

The exported proxy package imported the internal sentryhandler package only to call MarkToSkip. That pulled github.com/getsentry/sentry-go, and much more, into the module graph of every consumer of proxy. Consumers had to list those modules as // indirect in their own go.mod.

The skip marker now lives in a small sentryskip package with no third-party dependencies. sentryhandler reads it from there and proxy marks errors through it.

Impact: the dependency closure of proxy drops from 250 to 130 non-std packages. sentry-go, badger, logrus, prometheus and others are gone. In a scratch consumer module, go.mod shrinks from 41 to 13 lines and go.sum from 265 to 92. A test now fails if sentry-go comes back into the closure.

Relates to !9243 (merged)

Agent context
  • New internal/grpc/middleware/sentryskip with WithMarker, MarkToSkip, ShouldSkip.
  • sentryhandler.MarkToSkip and its context key were removed; the tests use sentryskip instead.
  • proxy/dependencies_test.go runs go list -deps on proxy and asserts no sentry-go package appears. golang.org/x/tools isn't in go.mod, so it shells out.
  • golangci-lint (repo config, with gitaly-linters) reports 0 issues on proxy/... and internal/grpc/middleware/.... go test passes for proxy/..., sentryhandler and sentryskip.
  • CI is intentionally skipped via the title while in draft.
Edited by Dmitry Gruzd

Merge request reports

Loading
Loading