Skip to content

Unable to send performance data to Sentry (echo integration) #642

@alexistdk

Description

@alexistdk

Summary

I'm following the documentation and I'm not able to send performance data to Sentry.io. This doesn't happen with other features like messages or events. In order to reproduce the error, I created a hello world app with a basic integration of Sentry.

Steps To Reproduce

Here you have the code https://go.dev/play/p/A9scQPjpE0r?v=goprev

package main

import (
	"fmt"
	"net/http"

	"github.com/getsentry/sentry-go"
	sentryecho "github.com/getsentry/sentry-go/echo"
	"github.com/labstack/echo/v4"
	"github.com/labstack/echo/v4/middleware"
)

func main() {

	// To initialize Sentry's handler, you need to initialize Sentry itself beforehand
	if err := sentry.Init(sentry.ClientOptions{
		Dsn: "mysecretkey",
		// Set TracesSampleRate to 1.0 to capture 100%
		// of transactions for performance monitoring.
		// We recommend adjusting this value in production,
		TracesSampleRate: 1.0,
		Debug:            true,
		Environment:      "localhost",
		Release:          "v1.0",
		EnableTracing:    true,
	}); err != nil {
		fmt.Printf("Sentry initialization failed: %v\n", err)
	}

	// Then create your app
	app := echo.New()

	app.Use(middleware.Logger())
	app.Use(middleware.Recover())

	// Once it's done, you can attach the handler as one of your middleware
	app.Use(sentryecho.New(sentryecho.Options{}))

	app.GET("/", func(c echo.Context) error {
		return c.String(http.StatusOK, "Hello, World!")
	})
	app.Logger.Fatal(app.Start(":1323"))
}

Expected Behavior

I'm expecting to see metrics.

Screenshots

image

Sentry.io Event

Environment

SDK

  • sentry-go version: 0.21.0
  • Go version: 1.19.5 linux/amd64
  • Using Go Modules?

Sentry

  • Using hosted Sentry in sentry.io? yes
  • Using your own Sentry installation? Version:
  • Anything particular to your environment that could be related to this issue?

Additional context

Metadata

Metadata

Assignees

Labels

No fields configured for issues without a type.

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions