diff --git a/cmd/api/init.go b/cmd/api/init.go index 9e2946f9..73742ad9 100644 --- a/cmd/api/init.go +++ b/cmd/api/init.go @@ -25,7 +25,6 @@ import ( "github.com/celenium-io/celestia-indexer/pkg/node/rpc" "github.com/dipdup-net/go-lib/config" "github.com/getsentry/sentry-go" - sentryotel "github.com/getsentry/sentry-go/otel" "github.com/grafana/pyroscope-go" "github.com/labstack/echo-contrib/echoprometheus" "github.com/labstack/echo/v4" @@ -33,8 +32,6 @@ import ( "github.com/pkg/errors" "github.com/rs/zerolog" "github.com/rs/zerolog/log" - "go.opentelemetry.io/otel" - sdktrace "go.opentelemetry.io/otel/sdk/trace" "golang.org/x/time/rate" "github.com/MarceloPetrucio/go-scalar-api-reference" @@ -155,7 +152,7 @@ func observableCacheSkipper(c echo.Context) bool { return false } -func initEcho(cfg ApiConfig, db postgres.Storage, env string) *echo.Echo { +func initEcho(cfg ApiConfig, env string) *echo.Echo { e := echo.New() e.Validator = handler.NewCelestiaApiValidator() @@ -238,7 +235,7 @@ func initEcho(cfg ApiConfig, db postgres.Storage, env string) *echo.Echo { } - if err := initSentry(e, db, cfg.SentryDsn, env); err != nil { + if err := initSentry(e, cfg.SentryDsn, env); err != nil { log.Err(err).Msg("sentry") } e.Server.IdleTimeout = time.Second * 30 @@ -522,7 +519,7 @@ func initHandlers(ctx context.Context, e *echo.Echo, cfg Config, db postgres.Sto } } -func initSentry(e *echo.Echo, db postgres.Storage, dsn, environment string) error { +func initSentry(e *echo.Echo, dsn, environment string) error { if dsn == "" { return nil } @@ -541,14 +538,6 @@ func initSentry(e *echo.Echo, db postgres.Storage, dsn, environment string) erro return errors.Wrap(err, "initialization") } - tp := sdktrace.NewTracerProvider( - sdktrace.WithSpanProcessor(sentryotel.NewSentrySpanProcessor()), - ) - otel.SetTracerProvider(tp) - otel.SetTextMapPropagator(sentryotel.NewSentryPropagator()) - - db.SetTracer(tp) - e.Use(SentryMiddleware()) return nil diff --git a/cmd/api/main.go b/cmd/api/main.go index 21ea2b39..acfe7e76 100644 --- a/cmd/api/main.go +++ b/cmd/api/main.go @@ -57,7 +57,7 @@ func main() { ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM, syscall.SIGINT) db := initDatabase(cfg.Database, cfg.Indexer.ScriptsDir) - e := initEcho(cfg.ApiConfig, db, cfg.Environment) + e := initEcho(cfg.ApiConfig, cfg.Environment) initDispatcher(ctx, db) initGasTracker(ctx, db) initHandlers(ctx, e, *cfg, db) diff --git a/cmd/api/routes_test.go b/cmd/api/routes_test.go index 52f92bce..617d95e2 100644 --- a/cmd/api/routes_test.go +++ b/cmd/api/routes_test.go @@ -118,7 +118,7 @@ func TestRoutes(t *testing.T) { BlobReceiver: "dal_node", } - e := initEcho(apiCfg, db, "development") + e := initEcho(apiCfg, "development") defer func() { err := e.Close() require.NoError(t, err) diff --git a/go.mod b/go.mod index e0bc3496..d6d0f0b4 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,6 @@ require ( github.com/fatih/structs v1.1.0 github.com/gabriel-vasile/mimetype v1.4.3 github.com/getsentry/sentry-go v0.30.0 - github.com/getsentry/sentry-go/otel v0.27.0 github.com/go-playground/validator/v10 v10.18.0 github.com/go-testfixtures/testfixtures/v3 v3.9.0 github.com/goccy/go-json v0.10.3 @@ -48,7 +47,6 @@ require ( github.com/uptrace/bun/driver/pgdriver v1.1.17 github.com/vmihailenco/msgpack/v5 v5.4.1 go.opentelemetry.io/otel v1.30.0 - go.opentelemetry.io/otel/sdk v1.30.0 go.opentelemetry.io/otel/trace v1.30.0 go.uber.org/mock v0.2.0 golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e diff --git a/go.sum b/go.sum index f836d087..450c371d 100644 --- a/go.sum +++ b/go.sum @@ -494,8 +494,6 @@ github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqG github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getsentry/sentry-go v0.30.0 h1:lWUwDnY7sKHaVIoZ9wYqRHJ5iEmoc0pqcRqFkosKzBo= github.com/getsentry/sentry-go v0.30.0/go.mod h1:WU9B9/1/sHDqeV8T+3VwwbjeR5MSXs/6aqG3mqZrezA= -github.com/getsentry/sentry-go/otel v0.27.0 h1:p06qcOWuwA5eZkIoJuWjQVBQGFAPrHibShoFKakDV2g= -github.com/getsentry/sentry-go/otel v0.27.0/go.mod h1:ulQ2Luf7K0eIiESCpcPaUZeQx6T0BS08hSPJx+xIZNg= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= diff --git a/internal/storage/postgres/core.go b/internal/storage/postgres/core.go index 4b2423ad..53beae1d 100644 --- a/internal/storage/postgres/core.go +++ b/internal/storage/postgres/core.go @@ -16,7 +16,6 @@ import ( "github.com/pkg/errors" "github.com/uptrace/bun" "github.com/uptrace/bun/migrate" - "go.opentelemetry.io/otel/trace" ) // Storage - @@ -226,13 +225,3 @@ func (s Storage) Close() error { } return nil } - -func (s Storage) SetTracer(tp trace.TracerProvider) { - s.Connection().DB().AddQueryHook( - NewSentryHook( - s.cfg.Database, - tp.Tracer("db"), - true, - ), - ) -}