Skip to content

Commit

Permalink
An attempt to get Sentry to work reliably behind multiple ingresses/p…
Browse files Browse the repository at this point in the history
…roxies
  • Loading branch information
f0o committed Sep 7, 2024
1 parent 322c29d commit 152f283
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion pkg/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"io/fs"
"log"
"net/http"
"strings"
"time"

"github.com/AS203038/looking-glass/pkg/http/grpc"
Expand Down Expand Up @@ -177,6 +178,8 @@ func ListenAndServe(ctx context.Context, cfg *utils.Config, rts utils.RouterMap,
"Grpc-Timeout", // Used for gRPC-web
"X-Grpc-Web", // Used for gRPC-web
"X-User-Agent", // Used for gRPC-web
"baggage", // Used for sentry
"sentry-trace", // Used for sentry
},
ExposedHeaders: []string{
"Content-Encoding", // Unused in web browsers, but added for future-proofing
Expand Down Expand Up @@ -209,7 +212,7 @@ func ListenAndServe(ctx context.Context, cfg *utils.Config, rts utils.RouterMap,
EnableTracing: true,
TracesSampleRate: cfg.Web.Sentry.SampleRate,
ProfilesSampleRate: 1.0,
Release: utils.Version(),
Release: strings.Split(utils.Version(), "+")[0],
Environment: cfg.Web.Sentry.Environment,
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion webui/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
init({
dsn: env.PUBLIC_SENTRY_DSN,
environment: env.PUBLIC_SENTRY_ENV,
release: env.PUBLIC_LG_VERSION,
release: env.PUBLIC_LG_VERSION?.split("+")[0],
integrations: [browserTracingIntegration(), replayIntegration()],
// tracePropagationTargets: [env.PUBLIC_GRPC_URL],
tracesSampleRate: parseFloat(env.PUBLIC_SENTRY_SAMPLE_RATE || "0.0"),
Expand Down

0 comments on commit 152f283

Please sign in to comment.