Skip to content

The only tool you need to know what is happening and how to fix it.

progress

dduxc2a9c72877c8
diff --git a/CLAUDE.md b/CLAUDE.md
index ec91050e..f2825f40 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -683,6 +683,25 @@ if err != nil {
- This pattern applies to all 500 Internal Server Error responses
- For client errors (400, 404), `c.JSON` with an error message is acceptable
+**Non-stopping errors:** For errors that should not abort the request (e.g., optional feature failed to load), use `traceway.CaptureException` to report them instead of `log.Printf`:
+
+```go
+// CORRECT - Report non-stopping errors via traceway
+if err != nil {
+ traceway.CaptureException(fmt.Errorf("failed to read session recording (key=%s): %w", key, err))
+}
+
+// WRONG - Do not use log.Printf for errors
+if err != nil {
+ log.Printf("Failed to read session recording (key=%s): %v", key, err)
+}
+```
+
+**Summary:**
+- **Stopping errors** (abort the request): `c.AbortWithError(status, traceway.NewStackTraceErrorf("reason: %w", err))`
+- **Non-stopping errors** (continue serving): `traceway.CaptureException(fmt.Errorf("reason: %w", err))`
+- **Always** wrap errors with `traceway.NewStackTraceErrorf` or `fmt.Errorf` using `%w` — never discard the original error
+
---
## Go Client SDK
diff --git a/backend/app/controllers/clientcontrollers/client.controller.go b/backend/app/controllers/clientcontrollers/client.controller.go
index 07554e3c..ce72d84d 100644
--- a/backend/app/controllers/clientcontrollers/client.controller.go
+++ b/backend/app/controllers/clientcontrollers/client.controller.go
@@ -6,11 +6,15 @@ import (
"backend/app/models"
"backend/app/models/clientmodels"
"backend/app/repositories"
+ "backend/app/storage"
+ "context"
"crypto/sha256"
"encoding/hex"
+ "fmt"
"net/http"
"regexp"
"strings"
+ "time"
"github.com/gin-gonic/gin"
"github.com/google/uuid"
@@ -52,6 +56,19 @@ func (e clientController) Report(c *gin.Context) {
exceptionStackTraceToInsert := []models.ExceptionStackTrace{}
metricRecordsToInsert := []models.MetricRecord{}
spansToInsert := []models.Span{}
+
+ type recordingWork struct {
+ Id uuid.UUID
+ ProjectId uuid.UUID
+ ExceptionId uuid.UUID
+ Events []byte
+ RecordedAt time.Time
+ }
+ var recordingsWork []recordingWork
+
+ // Map frontend sessionRecordingId → backend-generated exception UUID
+ recordingIdToExceptionId := map[string]uuid.UUID{}
+
for _, cf := range request.CollectionFrames {
for _, ct := range cf.Traces {
if ct.IsTask {
@@ -64,7 +81,6 @@ func (e clientController) Report(c *gin.Context) {
endpointsToInsert = append(endpointsToInsert, e)
}
- // Extract spans from trace
for _, cs := range ct.Spans {
span := cs.ToSpan(ct.ParsedId())
span.ProjectId = projectId
@@ -76,6 +92,9 @@ func (e clientController) Report(c *gin.Context) {
est := cst.ToExceptionStackTrace(computeExceptionHash(cst.StackTrace, cst.IsMessage), request.AppVersion, request.ServerName)
est.Id = uuid.New()
est.ProjectId = projectId
+ if cst.SessionRecordingId != nil {
+ recordingIdToExceptionId[*cst.SessionRecordingId] = est.Id
+ }
exceptionStackTraceToInsert = append(exceptionStackTraceToInsert, est)
}
@@ -84,6 +103,20 @@ func (e clientController) Report(c *gin.Context) {
mr.ProjectId = projectId
metricRecordsToInsert = append(metricRecordsToInsert, mr)
}
+
+ for _, sr := range cf.SessionRecordings {
+ exceptionId, ok := recordingIdToExceptionId[sr.ExceptionId]
+ if !ok {
+ continue
+ }
+ recordingsWork = append(recordingsWork, recordingWork{
+ Id: uuid.New(),
+ ProjectId: projectId,
+ ExceptionId: exceptionId,
+ Events: sr.Events,
+ RecordedAt: time.Now().UTC(),
+ })
+ }
}
if len(endpointsToInsert) > 0 {
@@ -123,7 +156,6 @@ func (e clientController) Report(c *gin.Context) {
return
}
- // Broadcast usage event
if project, exists := c.Get(middleware.ProjectContextKey); exists {
if p, ok := project.(*models.Project); ok && p.OrganizationId != nil {
hooks.BroadcastReport(hooks.ReportEvent{
@@ -131,10 +163,34 @@ func (e clientController) Report(c *gin.Context) {
EndpointCount: len(endpointsToInsert),
ErrorCount: len(exceptionStackTraceToInsert),
TaskCount: len(tasksToInsert),
+ RecordingCount: len(recordingsWork),
})
}
}
+ if len(recordingsWork) > 0 {
+ work := recordingsWork
+ go func() {
+ for _, rw := range work {
+ key := fmt.Sprintf("recordings/%s/%s.json", rw.ProjectId, rw.ExceptionId)
+ if err := storage.Store.Write(context.Background(), key, rw.Events); err != nil {
+ traceway.CaptureException(fmt.Errorf("failed to write session recording (key=%s): %w", key, err))
+ continue
+ }
+ err := repositories.SessionRecordingRepository.InsertAsync(context.Background(), []models.SessionRecording{{
+ Id: rw.Id,
+ ProjectId: rw.ProjectId,
+ ExceptionId: rw.ExceptionId,
+ FilePath: key,
+ RecordedAt: rw.RecordedAt,
+ }})
+ if err != nil {
+ traceway.CaptureException(fmt.Errorf("failed to insert session recording ref (key=%s): %w", key, err))
+ }
+ }
+ }()
+ }
+
c.JSON(http.StatusOK, gin.H{})
}
@@ -156,41 +212,19 @@ func computeExceptionHash(stackTrace string, isMessage bool) string {
normalized := stackTrace
if !isMessage {
- // Only normalize for actual exceptions, not messages
- // Remove the error message content (keep just the error type)
normalized = errorMessageRe.ReplaceAllString(normalized, "$1")
-
- // Remove absolute paths, keep just filename:line
normalized = absolutePathRe.ReplaceAllString(normalized, "$1")
-
- // Remove version numbers from module paths
normalized = versionRe.ReplaceAllString(normalized, "")
-
- // Replace hex addresses/pointers
normalized = hexRe.ReplaceAllString(normalized, "<hex>")
-
- // Replace UUIDs
normalized = uuidRe.ReplaceAllString(normalized, "<uuid>")
-
- // Replace standalone large numbers (likely IDs, not line numbers)
- // Since Go doesn't support lookbehind, we preserve the surrounding characters
normalized = largeNumberRe.ReplaceAllString(normalized, "${1}<id>${3}")
-
- // Replace email addresses
normalized = emailRe.ReplaceAllString(normalized, "<email>")
-
- // Replace IP addresses
normalized = ipRe.ReplaceAllString(normalized, "<ip>")
-
- // Normalize goroutine numbers
normalized = goroutineRe.ReplaceAllString(normalized, "goroutine <n>")
-
- // Normalize whitespace
normalized = spacesRe.ReplaceAllString(normalized, " ")
normalized = newlinesRe.ReplaceAllString(normalized, "\n")
}
- // Compute SHA-256 and return first 16 hex characters
normalized = strings.TrimSpace(normalized)
hash := sha256.Sum256([]byte(normalized))
return hex.EncodeToString(hash[:])[:16]
diff --git a/backend/app/controllers/exception_stack_trace.controller.go b/backend/app/controllers/exception_stack_trace.controller.go
index 4ff36ae2..d0628242 100644
--- a/backend/app/controllers/exception_stack_trace.controller.go
+++ b/backend/app/controllers/exception_stack_trace.controller.go
@@ -4,6 +4,11 @@ import (
"backend/app/middleware"
"backend/app/models"
"backend/app/repositories"
+ "backend/app/storage"
+ "database/sql"
+ "encoding/json"
+ "errors"
+ "fmt"
"net/http"
"strings"
"time"
@@ -34,9 +39,10 @@ type ExceptionDetailRequest struct {
}
type ExceptionDetailResponse struct {
- Group *models.ExceptionGroup `json:"group"`
- Occurrences []models.ExceptionStackTrace `json:"occurrences"`
- Pagination Pagination `json:"pagination"`
+ Group *models.ExceptionGroup `json:"group"`
+ Occurrences []models.ExceptionStackTrace `json:"occurrences"`
+ Pagination Pagination `json:"pagination"`
+ SessionRecordingEvents json.RawMessage `json:"sessionRecordingEvents,omitempty"`
}
func (e exceptionStackTraceController) FindGrouppedExceptionStackTraces(c *gin.Context) {
@@ -132,7 +138,7 @@ func (e exceptionStackTraceController) FindByHash(c *gin.Context) {
return
}
- c.JSON(http.StatusOK, ExceptionDetailResponse{
+ response := ExceptionDetailResponse{
Group: group,
Occurrences: occurrences,
Pagination: Pagination{
@@ -141,7 +147,23 @@ func (e exceptionStackTraceController) FindByHash(c *gin.Context) {
Total: total,
TotalPages: (total + int64(request.Pagination.PageSize) - 1) / int64(request.Pagination.PageSize),
},
- })
+ }
+
+ if len(occurrences) > 0 {
+ filePath, err := repositories.SessionRecordingRepository.FindByExceptionId(c, projectId, occurrences[0].Id)
+ if err == nil && filePath != "" {
+ eventsData, err := storage.Store.Read(c, filePath)
+ if err == nil {
+ response.SessionRecordingEvents = json.RawMessage(eventsData)
+ } else {
+ traceway.CaptureException(fmt.Errorf("failed to read session recording (key=%s): %w", filePath, err))
+ }
+ } else if err != nil && !errors.Is(err, sql.ErrNoRows) {
+ traceway.CaptureException(fmt.Errorf("failed to load session recording ref for exception %s: %w", occurrences[0].Id, err))
+ }
+ }
+
+ c.JSON(http.StatusOK, response)
}
func (e exceptionStackTraceController) ArchiveExceptions(c *gin.Context) {
@@ -224,7 +246,21 @@ func (e exceptionStackTraceController) FindById(c *gin.Context) {
return
}
- c.JSON(http.StatusOK, gin.H{"exception": exception})
+ response := gin.H{"exception": exception}
+
+ filePath, err := repositories.SessionRecordingRepository.FindByExceptionId(c, projectId, exceptionId)
+ if err == nil && filePath != "" {
+ eventsData, err := storage.Store.Read(c, filePath)
+ if err == nil {
+ response["sessionRecordingEvents"] = json.RawMessage(eventsData)
+ } else {
+ traceway.CaptureException(fmt.Errorf("failed to read session recording (key=%s): %w", filePath, err))
+ }
+ } else if err != nil && !errors.Is(err, sql.ErrNoRows) {
+ traceway.CaptureException(fmt.Errorf("failed to load session recording ref for exception %s: %w", exceptionId, err))
+ }
+
+ c.JSON(http.StatusOK, response)
}
var ExceptionStackTraceController = exceptionStackTraceController{}
diff --git a/backend/app/hooks/report_hooks.go b/backend/app/hooks/report_hooks.go
index 2b9f46bf..c43a2302 100644
--- a/backend/app/hooks/report_hooks.go
+++ b/backend/app/hooks/report_hooks.go
@@ -7,6 +7,7 @@ type ReportEvent struct {
EndpointCount int
ErrorCount int
TaskCount int
+ RecordingCount int
}
var (
diff --git a/backend/app/migrations/ch/0024_create_session_recordings.up.sql b/backend/app/migrations/ch/0024_create_session_recordings.up.sql
new file mode 100644
index 00000000..3149d864
--- /dev/null
+++ b/backend/app/migrations/ch/0024_create_session_recordings.up.sql
@@ -0,0 +1,13 @@
+CREATE TABLE IF NOT EXISTS session_recordings
+(
+ `id` UUID,
+ `project_id` UUID,
+ `exception_id` UUID,
+ `events` String,
+ `recorded_at` DateTime,
+ INDEX idx_exception_id exception_id TYPE bloom_filter(0.001) GRANULARITY 1
+)
+ENGINE = MergeTree
+PARTITION BY toYYYYMMDD(recorded_at)
+ORDER BY (project_id, recorded_at, exception_id)
+SETTINGS index_granularity = 8192
diff --git a/backend/app/migrations/ch/0025_add_file_path_to_session_recordings.up.sql b/backend/app/migrations/ch/0025_add_file_path_to_session_recordings.up.sql
new file mode 100644
index 00000000..9bfa9590
--- /dev/null
+++ b/backend/app/migrations/ch/0025_add_file_path_to_session_recordings.up.sql
@@ -0,0 +1 @@
+ALTER TABLE session_recordings ADD COLUMN file_path String DEFAULT ''
\ No newline at end of file
diff --git a/backend/app/migrations/ch/0026_drop_events_from_session_recordings.up.sql b/backend/app/migrations/ch/0026_drop_events_from_session_recordings.up.sql
new file mode 100644
index 00000000..631de2d9
--- /dev/null
+++ b/backend/app/migrations/ch/0026_drop_events_from_session_recordings.up.sql
@@ -0,0 +1 @@
+ALTER TABLE session_recordings DROP COLUMN events
\ No newline at end of file
diff --git a/backend/app/models/clientmodels/clientmodels.model.go b/backend/app/models/clientmodels/clientmodels.model.go
index de6ee1b1..aaf575be 100644
--- a/backend/app/models/clientmodels/clientmodels.model.go
+++ b/backend/app/models/clientmodels/clientmodels.model.go
@@ -2,18 +2,20 @@ package clientmodels
import (
"backend/app/models"
+ "encoding/json"
"time"
"github.com/google/uuid"
)
type ClientExceptionStackTrace struct {
- TraceId *string `json:"traceId"`
- IsTask bool `json:"isTask"`
- StackTrace string `json:"stackTrace"`
- RecordedAt time.Time `json:"recordedAt"`
- Attributes map[string]string `json:"attributes"`
- IsMessage bool `json:"isMessage"`
+ TraceId *string `json:"traceId"`
+ IsTask bool `json:"isTask"`
+ StackTrace string `json:"stackTrace"`
+ RecordedAt time.Time `json:"recordedAt"`
+ Attributes map[string]string `json:"attributes"`
+ IsMessage bool `json:"isMessage"`
+ SessionRecordingId *string `json:"sessionRecordingId"`
}
func (c *ClientExceptionStackTrace) ToExceptionStackTrace(exceptionHash, appVersion, serverName string) models.ExceptionStackTrace {
@@ -132,8 +134,14 @@ func (c *ClientSpan) ToSpan(traceId uuid.UUID) models.Span {
}
}
+type ClientSessionRecording struct {
+ ExceptionId string `json:"exceptionId"`
+ Events json.RawMessage `json:"events"`
+}
+
type CollectionFrame struct {
- StackTraces []*ClientExceptionStackTrace `json:"stackTraces"`
- Metrics []*ClientMetricRecord `json:"metrics"`
- Traces []*ClientTrace `json:"traces"`
+ StackTraces []*ClientExceptionStackTrace `json:"stackTraces"`
+ Metrics []*ClientMetricRecord `json:"metrics"`
+ Traces []*ClientTrace `json:"traces"`
+ SessionRecordings []*ClientSessionRecording `json:"sessionRecordings"`
}
diff --git a/backend/app/models/session_recording.model.go b/backend/app/models/session_recording.model.go
new file mode 100644
index 00000000..bed4db2f
--- /dev/null
+++ b/backend/app/models/session_recording.model.go
@@ -0,0 +1,15 @@
+package models
+
+import (
+ "time"
+
+ "github.com/google/uuid"
+)
+
+type SessionRecording struct {
+ Id uuid.UUID `json:"id" ch:"id"`
+ ProjectId uuid.UUID `json:"projectId" ch:"project_id"`
+ ExceptionId uuid.UUID `json:"exceptionId" ch:"exception_id"`
+ FilePath string `json:"filePath" ch:"file_path"`
+ RecordedAt time.Time `json:"recordedAt" ch:"recorded_at"`
+}
diff --git a/backend/app/repositories/session_recording.repository.go b/backend/app/repositories/session_recording.repository.go
new file mode 100644
index 00000000..bcee140f
--- /dev/null
+++ b/backend/app/repositories/session_recording.repository.go
@@ -0,0 +1,46 @@
+package repositories
+
+import (
+ "backend/app/chdb"
+ "backend/app/models"
+ "context"
+ "database/sql"
+ "errors"
+
+ "github.com/ClickHouse/clickhouse-go/v2"
+ "github.com/google/uuid"
+)
+
+type sessionRecordingRepository struct{}
+
+func (r *sessionRecordingRepository) InsertAsync(ctx context.Context, recordings []models.SessionRecording) error {
+ if len(recordings) == 0 {
+ return nil
+ }
+ batch, err := (*chdb.Conn).PrepareBatch(clickhouse.Context(context.Background(), clickhouse.WithAsync(false)), "INSERT INTO session_recordings (id, project_id, exception_id, file_path, recorded_at)")
+ if err != nil {
+ return err
+ }
+ for _, rec := range recordings {
+ if err := batch.Append(rec.Id, rec.ProjectId, rec.ExceptionId, rec.FilePath, rec.RecordedAt); err != nil {
+ return err
+ }
+ }
+ return batch.Send()
+}
+
+func (r *sessionRecordingRepository) FindByExceptionId(ctx context.Context, projectId uuid.UUID, exceptionId uuid.UUID) (string, error) {
+ var filePath string
+ err := (*chdb.Conn).QueryRow(ctx,
+ "SELECT file_path FROM session_recordings WHERE project_id = ? AND exception_id = ? ORDER BY recorded_at DESC LIMIT 1",
+ projectId, exceptionId).Scan(&filePath)
+ if err != nil {
+ if errors.Is(err, sql.ErrNoRows) {
+ return "", sql.ErrNoRows
+ }
+ return "", err
+ }
+ return filePath, nil
+}
+
+var SessionRecordingRepository = sessionRecordingRepository{}
diff --git a/backend/app/storage/local.go b/backend/app/storage/local.go
new file mode 100644
index 00000000..604e3410
--- /dev/null
+++ b/backend/app/storage/local.go
@@ -0,0 +1,47 @@
+package storage
+
+import (
+ "context"
+ "fmt"
+ "os"
+ "path/filepath"
+)
+
+type localStorage struct {
+ basePath string
+}
+
+func NewLocalStorage(basePath string) (*localStorage, error) {
+ abs, err := filepath.Abs(basePath)
+ if err != nil {
+ return nil, fmt.Errorf("failed to resolve absolute path: %w", err)
+ }
+ if err := os.MkdirAll(abs, 0755); err != nil {
+ return nil, fmt.Errorf("failed to create base directory: %w", err)
+ }
+ return &localStorage{basePath: abs}, nil
+}
+
+func (l *localStorage) Write(_ context.Context, key string, data []byte) error {
+ fullPath := filepath.Join(l.basePath, key)
+ dir := filepath.Dir(fullPath)
+ if err := os.MkdirAll(dir, 0755); err != nil {
+ return fmt.Errorf("failed to create directory %s: %w", dir, err)
+ }
+ if err := os.WriteFile(fullPath, data, 0644); err != nil {
+ return fmt.Errorf("failed to write file %s: %w", fullPath, err)
+ }
+ return nil
+}
+
+func (l *localStorage) Read(_ context.Context, key string) ([]byte, error) {
+ fullPath := filepath.Join(l.basePath, key)
+ data, err := os.ReadFile(fullPath)
+ if err != nil {
+ if os.IsNotExist(err) {
+ return nil, fmt.Errorf("file not found: %s", key)
+ }
+ return nil, fmt.Errorf("failed to read file %s: %w", fullPath, err)
+ }
+ return data, nil
+}
diff --git a/backend/app/storage/s3.go b/backend/app/storage/s3.go
new file mode 100644
index 00000000..a424b82e
--- /dev/null
+++ b/backend/app/storage/s3.go
@@ -0,0 +1,73 @@
+package storage
+
+import (
+ "bytes"
+ "context"
+ "fmt"
+ "io"
+
+ "github.com/aws/aws-sdk-go-v2/aws"
+ "github.com/aws/aws-sdk-go-v2/config"
+ "github.com/aws/aws-sdk-go-v2/credentials"
+ "github.com/aws/aws-sdk-go-v2/service/s3"
+)
+
+type s3Storage struct {
+ client *s3.Client
+ bucket string
+}
+
+func NewS3Storage(bucket, region, accessKey, secretKey, endpoint string) (*s3Storage, error) {
+ var opts []func(*config.LoadOptions) error
+ opts = append(opts, config.WithRegion(region))
+
+ if accessKey != "" && secretKey != "" {
+ opts = append(opts, config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider(accessKey, secretKey, "")))
+ }
+
+ cfg, err := config.LoadDefaultConfig(context.Background(), opts...)
+ if err != nil {
+ return nil, fmt.Errorf("failed to load AWS config: %w", err)
+ }
+
+ var s3Opts []func(*s3.Options)
+ if endpoint != "" {
+ s3Opts = append(s3Opts, func(o *s3.Options) {
+ o.BaseEndpoint = aws.String(endpoint)
+ o.UsePathStyle = true
+ })
+ }
+
+ client := s3.NewFromConfig(cfg, s3Opts...)
+ return &s3Storage{client: client, bucket: bucket}, nil
+}
+
+func (s *s3Storage) Write(ctx context.Context, key string, data []byte) error {
+ _, err := s.client.PutObject(ctx, &s3.PutObjectInput{
+ Bucket: aws.String(s.bucket),
+ Key: aws.String(key),
+ Body: bytes.NewReader(data),
+ ContentType: aws.String("application/json"),
+ })
+ if err != nil {
+ return fmt.Errorf("failed to put object %s: %w", key, err)
+ }
+ return nil
+}
+
+func (s *s3Storage) Read(ctx context.Context, key string) ([]byte, error) {
+ output, err := s.client.GetObject(ctx, &s3.GetObjectInput{
+ Bucket: aws.String(s.bucket),
+ Key: aws.String(key),
+ })
+ if err != nil {
+ return nil, fmt.Errorf("failed to get object %s: %w", key, err)
+ }
+ defer output.Body.Close()
+
+ data, err := io.ReadAll(output.Body)
+ if err != nil {
+ return nil, fmt.Errorf("failed to read object body %s: %w", key, err)
+ }
+ return data, nil
+}
diff --git a/backend/app/storage/storage.go b/backend/app/storage/storage.go
new file mode 100644
index 00000000..7c5694bf
--- /dev/null
+++ b/backend/app/storage/storage.go
@@ -0,0 +1,52 @@
+package storage
+
+import (
+ "context"
+ "fmt"
+ "os"
+)
+
+type Storage interface {
+ Write(ctx context.Context, key string, data []byte) error
+ Read(ctx context.Context, key string) ([]byte, error)
+}
+
+var Store Storage
+
+func Init() error {
+ storageType := os.Getenv("STORAGE_TYPE")
+ if storageType == "" {
+ storageType = "local"
+ }
+
+ switch storageType {
+ case "local":
+ path := os.Getenv("STORAGE_PATH")
+ if path == "" {
+ path = "./storage"
+ }
+ s, err := NewLocalStorage(path)
+ if err != nil {
+ return fmt.Errorf("failed to create local storage: %w", err)
+ }
+ Store = s
+ case "s3":
+ bucket := os.Getenv("S3_BUCKET")
+ if bucket == "" {
+ return fmt.Errorf("S3_BUCKET is required when STORAGE_TYPE=s3")
+ }
+ region := os.Getenv("S3_REGION")
+ if region == "" {
+ return fmt.Errorf("S3_REGION is required when STORAGE_TYPE=s3")
+ }
+ s, err := NewS3Storage(bucket, region, os.Getenv("S3_ACCESS_KEY"), os.Getenv("S3_SECRET_KEY"), os.Getenv("S3_ENDPOINT"))
+ if err != nil {
+ return fmt.Errorf("failed to create S3 storage: %w", err)
+ }
+ Store = s
+ default:
+ return fmt.Errorf("unknown STORAGE_TYPE: %s", storageType)
+ }
+
+ return nil
+}
diff --git a/backend/cmd/run.go b/backend/cmd/run.go
index 5ae3cdc1..74110fd8 100644
--- a/backend/cmd/run.go
+++ b/backend/cmd/run.go
@@ -9,6 +9,7 @@ import (
"backend/app/models"
"backend/app/pgdb"
"backend/app/services"
+ "backend/app/storage"
"backend/static"
"context"
"fmt"
@@ -46,6 +47,10 @@ func Run() {
models.Init()
+ if err := storage.Init(); err != nil {
+ panic(fmt.Errorf("failed to initialize storage: %w", err))
+ }
+
err = migrations.Run()
if err != nil {
panic(fmt.Errorf("migrations run failed: %w", err))
diff --git a/backend/go.mod b/backend/go.mod
index d9ded05d..91fbb802 100644
--- a/backend/go.mod
+++ b/backend/go.mod
@@ -3,6 +3,10 @@ module backend
go 1.25.1
require (
+ github.com/aws/aws-sdk-go-v2 v1.41.1
+ github.com/aws/aws-sdk-go-v2/config v1.32.7
+ github.com/aws/aws-sdk-go-v2/credentials v1.19.7
+ github.com/aws/aws-sdk-go-v2/service/s3 v1.96.0
github.com/coreos/go-systemd/v22 v22.6.0
github.com/golang-jwt/jwt/v5 v5.3.0
github.com/lib/pq v1.10.9
@@ -14,6 +18,21 @@ require (
require (
github.com/ClickHouse/ch-go v0.69.0 // indirect
github.com/andybalholm/brotli v1.2.0 // indirect
+ github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.4 // indirect
+ github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.17 // indirect
+ github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.17 // indirect
+ github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.17 // indirect
+ github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 // indirect
+ github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.17 // indirect
+ github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4 // indirect
+ github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.8 // indirect
+ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.17 // indirect
+ github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.17 // indirect
+ github.com/aws/aws-sdk-go-v2/service/signin v1.0.5 // indirect
+ github.com/aws/aws-sdk-go-v2/service/sso v1.30.9 // indirect
+ github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.13 // indirect
+ github.com/aws/aws-sdk-go-v2/service/sts v1.41.6 // indirect
+ github.com/aws/smithy-go v1.24.0 // indirect
github.com/bytedance/sonic v1.14.0 // indirect
github.com/bytedance/sonic/loader v0.3.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
diff --git a/backend/go.sum b/backend/go.sum
index 59925a5b..6b6b1b6b 100644
--- a/backend/go.sum
+++ b/backend/go.sum
@@ -12,6 +12,44 @@ github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERo
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/andybalholm/brotli v1.2.0 h1:ukwgCxwYrmACq68yiUqwIWnGY0cTPox/M94sVwToPjQ=
github.com/andybalholm/brotli v1.2.0/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY=
+github.com/aws/aws-sdk-go-v2 v1.41.1 h1:ABlyEARCDLN034NhxlRUSZr4l71mh+T5KAeGh6cerhU=
+github.com/aws/aws-sdk-go-v2 v1.41.1/go.mod h1:MayyLB8y+buD9hZqkCW3kX1AKq07Y5pXxtgB+rRFhz0=
+github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.4 h1:489krEF9xIGkOaaX3CE/Be2uWjiXrkCH6gUX+bZA/BU=
+github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.4/go.mod h1:IOAPF6oT9KCsceNTvvYMNHy0+kMF8akOjeDvPENWxp4=
+github.com/aws/aws-sdk-go-v2/config v1.32.7 h1:vxUyWGUwmkQ2g19n7JY/9YL8MfAIl7bTesIUykECXmY=
+github.com/aws/aws-sdk-go-v2/config v1.32.7/go.mod h1:2/Qm5vKUU/r7Y+zUk/Ptt2MDAEKAfUtKc1+3U1Mo3oY=
+github.com/aws/aws-sdk-go-v2/credentials v1.19.7 h1:tHK47VqqtJxOymRrNtUXN5SP/zUTvZKeLx4tH6PGQc8=
+github.com/aws/aws-sdk-go-v2/credentials v1.19.7/go.mod h1:qOZk8sPDrxhf+4Wf4oT2urYJrYt3RejHSzgAquYeppw=
+github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.17 h1:I0GyV8wiYrP8XpA70g1HBcQO1JlQxCMTW9npl5UbDHY=
+github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.17/go.mod h1:tyw7BOl5bBe/oqvoIeECFJjMdzXoa/dfVz3QQ5lgHGA=
+github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.17 h1:xOLELNKGp2vsiteLsvLPwxC+mYmO6OZ8PYgiuPJzF8U=
+github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.17/go.mod h1:5M5CI3D12dNOtH3/mk6minaRwI2/37ifCURZISxA/IQ=
+github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.17 h1:WWLqlh79iO48yLkj1v3ISRNiv+3KdQoZ6JWyfcsyQik=
+github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.17/go.mod h1:EhG22vHRrvF8oXSTYStZhJc1aUgKtnJe+aOiFEV90cM=
+github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 h1:WKuaxf++XKWlHWu9ECbMlha8WOEGm0OUEZqm4K/Gcfk=
+github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4/go.mod h1:ZWy7j6v1vWGmPReu0iSGvRiise4YI5SkR3OHKTZ6Wuc=
+github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.17 h1:JqcdRG//czea7Ppjb+g/n4o8i/R50aTBHkA7vu0lK+k=
+github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.17/go.mod h1:CO+WeGmIdj/MlPel2KwID9Gt7CNq4M65HUfBW97liM0=
+github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4 h1:0ryTNEdJbzUCEWkVXEXoqlXV72J5keC1GvILMOuD00E=
+github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.4/go.mod h1:HQ4qwNZh32C3CBeO6iJLQlgtMzqeG17ziAA/3KDJFow=
+github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.8 h1:Z5EiPIzXKewUQK0QTMkutjiaPVeVYXX7KIqhXu/0fXs=
+github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.8/go.mod h1:FsTpJtvC4U1fyDXk7c71XoDv3HlRm8V3NiYLeYLh5YE=
+github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.17 h1:RuNSMoozM8oXlgLG/n6WLaFGoea7/CddrCfIiSA+xdY=
+github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.17/go.mod h1:F2xxQ9TZz5gDWsclCtPQscGpP0VUOc8RqgFM3vDENmU=
+github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.17 h1:bGeHBsGZx0Dvu/eJC0Lh9adJa3M1xREcndxLNZlve2U=
+github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.17/go.mod h1:dcW24lbU0CzHusTE8LLHhRLI42ejmINN8Lcr22bwh/g=
+github.com/aws/aws-sdk-go-v2/service/s3 v1.96.0 h1:oeu8VPlOre74lBA/PMhxa5vewaMIMmILM+RraSyB8KA=
+github.com/aws/aws-sdk-go-v2/service/s3 v1.96.0/go.mod h1:5jggDlZ2CLQhwJBiZJb4vfk4f0GxWdEDruWKEJ1xOdo=
+github.com/aws/aws-sdk-go-v2/service/signin v1.0.5 h1:VrhDvQib/i0lxvr3zqlUwLwJP4fpmpyD9wYG1vfSu+Y=
+github.com/aws/aws-sdk-go-v2/service/signin v1.0.5/go.mod h1:k029+U8SY30/3/ras4G/Fnv/b88N4mAfliNn08Dem4M=
+github.com/aws/aws-sdk-go-v2/service/sso v1.30.9 h1:v6EiMvhEYBoHABfbGB4alOYmCIrcgyPPiBE1wZAEbqk=
+github.com/aws/aws-sdk-go-v2/service/sso v1.30.9/go.mod h1:yifAsgBxgJWn3ggx70A3urX2AN49Y5sJTD1UQFlfqBw=
+github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.13 h1:gd84Omyu9JLriJVCbGApcLzVR3XtmC4ZDPcAI6Ftvds=
+github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.13/go.mod h1:sTGThjphYE4Ohw8vJiRStAcu3rbjtXRsdNB0TvZ5wwo=
+github.com/aws/aws-sdk-go-v2/service/sts v1.41.6 h1:5fFjR/ToSOzB2OQ/XqWpZBmNvmP/pJ1jOWYlFDJTjRQ=
+github.com/aws/aws-sdk-go-v2/service/sts v1.41.6/go.mod h1:qgFDZQSD/Kys7nJnVqYlWKnh0SSdMjAi0uSwON4wgYQ=
+github.com/aws/smithy-go v1.24.0 h1:LpilSUItNPFr1eY85RYgTIg5eIEPtvFbskaFcmmIUnk=
+github.com/aws/smithy-go v1.24.0/go.mod h1:LEj2LM3rBRQJxPZTB4KuzZkaZYnZPnvgIhb4pu07mx0=
github.com/bytedance/sonic v1.14.0 h1:/OfKt8HFw0kh2rj8N0F6C/qPGRESq0BbaNZgcNXXzQQ=
github.com/bytedance/sonic v1.14.0/go.mod h1:WoEbx8WTcFJfzCe0hbmyTGrfjt8PzNEBdxlNUO24NhA=
github.com/bytedance/sonic/loader v0.3.0 h1:dskwH8edlzNMctoruo8FPTJDF3vLtDT0sXZwvZJyqeA=
diff --git a/frontend/package-lock.json b/frontend/package-lock.json
index 687caec1..d3cc592d 100644
--- a/frontend/package-lock.json
+++ b/frontend/package-lock.json
@@ -12,6 +12,7 @@
"@tracewayapp/svelte": "^0.3.0",
"lucide-svelte": "^0.562.0",
"luxon": "^3.7.2",
+ "rrweb-player": "^2.0.0-alpha.18",
"svelte-highlight": "^7.9.0",
"svelte-sonner": "^1.0.7"
},
@@ -1134,6 +1135,38 @@
"win32"
]
},
+ "node_modules/@rrweb/packer": {
+ "version": "2.0.0-alpha.20",
+ "resolved": "https://registry.npmjs.org/@rrweb/packer/-/packer-2.0.0-alpha.20.tgz",
+ "integrity": "sha512-GsByg2olGZ2n3To6keFG604QAboipuXZvjYxO2wITSwARBf/sZdy6cbUEjF0RS+QnuTM5GaVXeQapNMLmpKbrA==",
+ "license": "MIT",
+ "dependencies": {
+ "@rrweb/types": "^2.0.0-alpha.20",
+ "fflate": "^0.4.4"
+ }
+ },
+ "node_modules/@rrweb/replay": {
+ "version": "2.0.0-alpha.20",
+ "resolved": "https://registry.npmjs.org/@rrweb/replay/-/replay-2.0.0-alpha.20.tgz",
+ "integrity": "sha512-VodsLb+C2bYNNVbb0U14tKLa9ctzUxYIlt9VnxPATWvfyXHLTku8BhRWptuW/iIjVjmG49LBoR1ilxw/HMiJ1w==",
+ "license": "MIT",
+ "dependencies": {
+ "@rrweb/types": "^2.0.0-alpha.20",
+ "rrweb": "^2.0.0-alpha.20"
+ }
+ },
+ "node_modules/@rrweb/types": {
+ "version": "2.0.0-alpha.20",
+ "resolved": "https://registry.npmjs.org/@rrweb/types/-/types-2.0.0-alpha.20.tgz",
+ "integrity": "sha512-RbnDgKxA/odwB1R4gF7eUUj+rdSrq6ROQJsnMw7MIsGzlbSYvJeZN8YY4XqU0G6sKJvXI6bSzk7w/G94jNwzhw==",
+ "license": "MIT"
+ },
+ "node_modules/@rrweb/utils": {
+ "version": "2.0.0-alpha.20",
+ "resolved": "https://registry.npmjs.org/@rrweb/utils/-/utils-2.0.0-alpha.20.tgz",
+ "integrity": "sha512-MTQOmhPRe39C0fYaCnnVYOufQsyGzwNXpUStKiyFSfGLUJrzuwhbRoUAKR5w6W2j5XuA0bIz3ZDIBztkquOhLw==",
+ "license": "MIT"
+ },
"node_modules/@standard-schema/spec": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz",
@@ -1626,6 +1659,12 @@
"svelte": ">=4.0.0"
}
},
+ "node_modules/@tsconfig/svelte": {
+ "version": "1.0.13",
+ "resolved": "https://registry.npmjs.org/@tsconfig/svelte/-/svelte-1.0.13.tgz",
+ "integrity": "sha512-5lYJP45Xllo4yE/RUBccBT32eBlRDbqN8r1/MIvQbKxW3aFqaYPCNgm8D5V20X4ShHcwvYWNlKg3liDh1MlBoA==",
+ "license": "MIT"
+ },
"node_modules/@types/cookie": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz",
@@ -1633,6 +1672,12 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/@types/css-font-loading-module": {
+ "version": "0.0.7",
+ "resolved": "https://registry.npmjs.org/@types/css-font-loading-module/-/css-font-loading-module-0.0.7.tgz",
+ "integrity": "sha512-nl09VhutdjINdWyXxHWN/w9zlNCfr60JUqJbd24YXUuCwgeL0TpFSdElCwb6cxfB6ybE19Gjj4g0jsgkXxKv1Q==",
+ "license": "MIT"
+ },
"node_modules/@types/d3-array": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.2.tgz",
@@ -1960,6 +2005,12 @@
"url": "https://opencollective.com/typescript-eslint"
}
},
+ "node_modules/@xstate/fsm": {
+ "version": "1.6.5",
+ "resolved": "https://registry.npmjs.org/@xstate/fsm/-/fsm-1.6.5.tgz",
+ "integrity": "sha512-b5o1I6aLNeYlU/3CPlj/Z91ybk1gUsKT+5NAJI+2W4UjvS5KLG28K9v5UvNoFVjHV8PajVZ00RH3vnjyQO7ZAw==",
+ "license": "MIT"
+ },
"node_modules/acorn": {
"version": "8.15.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",
@@ -2047,6 +2098,15 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/base64-arraybuffer": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz",
+ "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6.0"
+ }
+ },
"node_modules/bits-ui": {
"version": "2.14.4",
"resolved": "https://registry.npmjs.org/bits-ui/-/bits-ui-2.14.4.tgz",
@@ -2723,6 +2783,12 @@
}
}
},
+ "node_modules/fflate": {
+ "version": "0.4.8",
+ "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.4.8.tgz",
+ "integrity": "sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA==",
+ "license": "MIT"
+ },
"node_modules/file-entry-cache": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",
@@ -3369,6 +3435,12 @@
"node": "*"
}
},
+ "node_modules/mitt": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz",
+ "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==",
+ "license": "MIT"
+ },
"node_modules/mri": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz",
@@ -3400,7 +3472,6 @@
"version": "3.3.11",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz",
"integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==",
- "dev": true,
"funding": [
{
"type": "github",
@@ -3509,7 +3580,6 @@
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
"integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
- "dev": true,
"license": "ISC"
},
"node_modules/picomatch": {
@@ -3529,7 +3599,6 @@
"version": "8.5.6",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz",
"integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==",
- "dev": true,
"funding": [
{
"type": "opencollective",
@@ -3854,6 +3923,51 @@
"fsevents": "~2.3.2"
}
},
+ "node_modules/rrdom": {
+ "version": "2.0.0-alpha.20",
+ "resolved": "https://registry.npmjs.org/rrdom/-/rrdom-2.0.0-alpha.20.tgz",
+ "integrity": "sha512-hoqjS4662LtBp82qEz9GrqU36UpEmCvTA2Hns3qdF7cklLFFy3G+0Th8hLytJENleHHWxsB5nWJ3eXz5mSRxdQ==",
+ "license": "MIT",
+ "dependencies": {
+ "rrweb-snapshot": "^2.0.0-alpha.20"
+ }
+ },
+ "node_modules/rrweb": {
+ "version": "2.0.0-alpha.20",
+ "resolved": "https://registry.npmjs.org/rrweb/-/rrweb-2.0.0-alpha.20.tgz",
+ "integrity": "sha512-CZKDlm+j1VA50Ko3gnMbpvguCAleljsTNXPnVk9aeNP8o6T6kolRbISHyDZpqZ4G+bdDLlQOignPP3jEsXs8Gg==",
+ "license": "MIT",
+ "dependencies": {
+ "@rrweb/types": "^2.0.0-alpha.20",
+ "@rrweb/utils": "^2.0.0-alpha.20",
+ "@types/css-font-loading-module": "0.0.7",
+ "@xstate/fsm": "^1.4.0",
+ "base64-arraybuffer": "^1.0.1",
+ "mitt": "^3.0.0",
+ "rrdom": "^2.0.0-alpha.20",
+ "rrweb-snapshot": "^2.0.0-alpha.20"
+ }
+ },
+ "node_modules/rrweb-player": {
+ "version": "2.0.0-alpha.20",
+ "resolved": "https://registry.npmjs.org/rrweb-player/-/rrweb-player-2.0.0-alpha.20.tgz",
+ "integrity": "sha512-3ZCv1ksUxuIOn3Vn/eWrwWs9Xy+4KVjISD+q26ZLfisZ3hZ0CPgYG3iC22pmmycIeMS2svOfvf7gPh7jExwpUA==",
+ "license": "MIT",
+ "dependencies": {
+ "@rrweb/packer": "^2.0.0-alpha.20",
+ "@rrweb/replay": "^2.0.0-alpha.20",
+ "@tsconfig/svelte": "^1.0.0"
+ }
+ },
+ "node_modules/rrweb-snapshot": {
+ "version": "2.0.0-alpha.20",
+ "resolved": "https://registry.npmjs.org/rrweb-snapshot/-/rrweb-snapshot-2.0.0-alpha.20.tgz",
+ "integrity": "sha512-YTNf9YVeaGRo/jxY3FKBge2c/Ojd/KTHmuWloUSB+oyPXuY73ZeeG873qMMmhIpqEn7hn7aBF1eWEQmP7wjf8A==",
+ "license": "MIT",
+ "dependencies": {
+ "postcss": "^8.4.38"
+ }
+ },
"node_modules/runed": {
"version": "0.35.1",
"resolved": "https://registry.npmjs.org/runed/-/runed-0.35.1.tgz",
@@ -3954,7 +4068,6 @@
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
"integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
- "dev": true,
"license": "BSD-3-Clause",
"engines": {
"node": ">=0.10.0"
diff --git a/frontend/package.json b/frontend/package.json
index 19933632..13421e3c 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -56,6 +56,7 @@
"@tracewayapp/svelte": "^0.3.0",
"lucide-svelte": "^0.562.0",
"luxon": "^3.7.2",
+ "rrweb-player": "^2.0.0-alpha.18",
"svelte-highlight": "^7.9.0",
"svelte-sonner": "^1.0.7"
}
diff --git a/frontend/src/lib/components/issues/event-card.svelte b/frontend/src/lib/components/issues/event-card.svelte
index 5f9790ff..892f85cd 100644
--- a/frontend/src/lib/components/issues/event-card.svelte
+++ b/frontend/src/lib/components/issues/event-card.svelte
@@ -8,10 +8,13 @@
import { getTimezone } from '$lib/state/timezone.svelte';
import { AttributesGrid } from '$lib/components/ui/attributes-grid';
import { LabelValue } from '../ui/label-value';
+ import { projectsState, isFrontendFramework } from '$lib/state/projects.svelte';
+ import SessionReplay from './session-replay.svelte';
interface Props {
occurrence: ExceptionOccurrence;
linkedTrace: LinkedTrace | null;
+ sessionRecordingEvents?: unknown[] | null;
title?: string;
description?: string;
timezone?: string;
@@ -20,14 +23,32 @@
let {
occurrence,
linkedTrace,
+ sessionRecordingEvents = null,
title = 'Event',
description = 'Details for this specific occurrence',
timezone
}: Props = $props();
const tz = $derived(timezone ?? getTimezone());
+ const isFrontend = $derived(
+ projectsState.currentProject?.framework
+ ? isFrontendFramework(projectsState.currentProject.framework)
+ : false
+ );
</script>
+<!-- Session Replay -->
+{#if sessionRecordingEvents && sessionRecordingEvents.length > 0}
+ <Card.Root class="pb-0">
+ <Card.Header class="gap-0">
+ <Card.Title>Session Replay</Card.Title>
+ </Card.Header>
+ <Card.Content class="p-0">
+ <SessionReplay events={sessionRecordingEvents} />
+ </Card.Content>
+ </Card.Root>
+{/if}
+
<Card.Root>
<Card.Header>
<Card.Title>{title}</Card.Title>
@@ -35,23 +56,27 @@
</Card.Header>
<Card.Content class="space-y-6">
<!-- Event Details -->
- <div class="grid grid-cols-2 gap-4 md:grid-cols-4">
+ <div class="grid grid-cols-2 gap-4 {isFrontend ? 'md:grid-cols-2' : 'md:grid-cols-4'}">
<div class="space-y-1">
<p class="text-sm text-muted-foreground">Recorded At</p>
<p class="font-mono text-sm">{formatDateTime(occurrence.recordedAt, { timezone: tz })}</p>
</div>
- <div class="space-y-1">
- <p class="text-sm text-muted-foreground">Server</p>
- <p class="font-mono text-sm">{occurrence.serverName || '-'}</p>
- </div>
+ {#if !isFrontend}
+ <div class="space-y-1">
+ <p class="text-sm text-muted-foreground">Server</p>
+ <p class="font-mono text-sm">{occurrence.serverName || '-'}</p>
+ </div>
+ {/if}
<div class="space-y-1">
<p class="text-sm text-muted-foreground">Version</p>
<p class="font-mono text-sm">{occurrence.appVersion || '-'}</p>
</div>
- <div class="space-y-1">
- <p class="text-sm text-muted-foreground">Trace</p>
- <p class="font-mono text-sm">{occurrence.traceId || '-'}</p>
- </div>
+ {#if !isFrontend}
+ <div class="space-y-1">
+ <p class="text-sm text-muted-foreground">Trace</p>
+ <p class="font-mono text-sm">{occurrence.traceId || '-'}</p>
+ </div>
+ {/if}
</div>
<!-- AttributesGrid -->
diff --git a/frontend/src/lib/components/issues/session-replay.svelte b/frontend/src/lib/components/issues/session-replay.svelte
new file mode 100644
index 00000000..75035738
--- /dev/null
+++ b/frontend/src/lib/components/issues/session-replay.svelte
@@ -0,0 +1,184 @@
+<script lang="ts">
+ import { onMount, onDestroy } from 'svelte';
+ import { Globe } from 'lucide-svelte';
+
+ interface Props {
+ events: unknown[] | null;
+ }
+
+ let { events }: Props = $props();
+ let container: HTMLElement;
+ let player: any = null;
+ let resizeObserver: ResizeObserver | null = null;
+
+ let pageUrl = $derived.by(() => {
+ if (!events || events.length === 0) return '';
+ const metaEvent = events.find((e: any) => e.type === 4);
+ return metaEvent?.data?.href ?? '';
+ });
+
+ function getPlayerHeight(width: number): number {
+ return Math.round((width * 9) / 16);
+ }
+
+ onMount(async () => {
+ if (!events || events.length === 0) return;
+
+ const { default: rrwebPlayer } = await import('rrweb-player');
+ await import('rrweb-player/dist/style.css');
+
+ const width = Math.round(container.clientWidth * 0.75);
+
+ player = new rrwebPlayer({
+ target: container,
+ props: { events, width, height: getPlayerHeight(width) }
+ });
+
+ resizeObserver = new ResizeObserver((entries) => {
+ for (const entry of entries) {
+ const newWidth = Math.round(entry.contentRect.width * 0.75);
+ if (player && newWidth > 0) {
+ player.$set({ width: newWidth, height: getPlayerHeight(newWidth) });
+ player.triggerResize();
+ }
+ }
+ });
+ resizeObserver.observe(container);
+ });
+
+ onDestroy(() => {
+ resizeObserver?.disconnect();
+ if (player) player.$destroy();
+ });
+</script>
+
+{#if events && events.length > 0}
+ <div class="player-wrapper overflow-hidden">
+ {#if pageUrl}
+ <div class="url-bar">
+ <Globe />
+ <span class="url-bar-text">{pageUrl}</span>
+ </div>
+ {/if}
+ <div bind:this={container} class="player-container"></div>
+ </div>
+{/if}
+
+<style>
+ .url-bar {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ padding: 8px 12px;
+ border-bottom: 1px solid var(--border);
+ border-top: 1px solid var(--border);
+ color: var(--muted-foreground);
+ }
+
+ .url-bar :global(svg) {
+ width: 14px;
+ height: 14px;
+ flex-shrink: 0;
+ }
+
+ .url-bar-text {
+ font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
+ font-size: 12px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ .player-container {
+ width: 100%;
+ }
+
+ /* rrweb player root */
+ .player-wrapper :global(.rr-player) {
+ width: 100% !important;
+ height: auto !important;
+ background: transparent !important;
+ box-shadow: none !important;
+ border-radius: 0 !important;
+ }
+
+ .player-wrapper :global(.rr-player__frame) {
+ margin: 0 auto !important;
+ }
+
+ /* Controller bar */
+ .player-wrapper :global(.rr-controller) {
+ background: var(--muted) !important;
+ border-top: 1px solid var(--border) !important;
+ border-radius: 0px 0px 9px 9px !important;
+ }
+
+ /* Timeline */
+ .player-wrapper :global(.rr-timeline) {
+ width: 100% !important;
+ }
+
+ .player-wrapper :global(.rr-timeline__time) {
+ font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
+ font-size: 12px !important;
+ color: var(--muted-foreground) !important;
+ }
+
+ /* Progress track */
+ .player-wrapper :global(.rr-progress) {
+ height: 6px !important;
+ background: var(--border) !important;
+ border-radius: 3px !important;
+ }
+
+ /* Progress fill */
+ .player-wrapper :global(.rr-progress__step) {
+ background: var(--chart-1) !important;
+ border-radius: 3px !important;
+ }
+
+ /* Progress handle */
+ .player-wrapper :global(.rr-progress__handler) {
+ width: 14px !important;
+ height: 14px !important;
+ background: var(--chart-1) !important;
+ border-radius: 50% !important;
+ top: -0px !important;
+ }
+
+ /* Buttons */
+ .player-wrapper :global(.rr-controller__btns button) {
+ color: var(--foreground) !important;
+ }
+
+ .player-wrapper :global(.rr-controller__btns button:hover) {
+ background: var(--accent) !important;
+ }
+
+ .player-wrapper :global(.rr-controller__btns button.active) {
+ background: var(--chart-1) !important;
+ }
+
+ .player-wrapper :global(.rr-controller__btns button:active) {
+ background: var(--chart-1) !important;
+ opacity: 0.8;
+ }
+
+ /* Switch toggle */
+ .player-wrapper :global(.switch label:before) {
+ background: var(--border) !important;
+ }
+
+ .player-wrapper :global(.switch input[type='checkbox']:checked + label:before) {
+ background: var(--chart-1) !important;
+ }
+
+ /* Replayer wrapper */
+ .player-wrapper :global(.replayer-wrapper) {
+ border-color: transparent !important;
+ }
+
+ .player-wrapper :global(.replayer-wrapper.touch-active) {
+ border-color: var(--chart-1) !important;
+ }
+</style>
diff --git a/frontend/src/routes/issues/[exceptionHash]/+page.svelte b/frontend/src/routes/issues/[exceptionHash]/+page.svelte
index 69adb931..7c3462a1 100644
--- a/frontend/src/routes/issues/[exceptionHash]/+page.svelte
+++ b/frontend/src/routes/issues/[exceptionHash]/+page.svelte
@@ -26,6 +26,7 @@
let notFound = $state(false);
let total = $state(0);
let linkedTrace = $state<LinkedTrace | null>(null);
+ let sessionRecordingEvents = $state<unknown[] | null>(null);
let showArchiveDialog = $state(false);
let archiving = $state(false);
@@ -40,6 +41,7 @@
error = '';
notFound = false;
linkedTrace = null;
+ sessionRecordingEvents = null;
try {
const exceptionHash = page.params.exceptionHash;
@@ -57,6 +59,7 @@
group = response.group;
occurrences = response.occurrences || [];
total = response.pagination.total;
+ sessionRecordingEvents = response.sessionRecordingEvents ?? null;
// Load linked trace if the latest occurrence has a traceId
const firstOccurrence = occurrences[0];
@@ -166,6 +169,7 @@
<EventCard
occurrence={latestOccurrence}
{linkedTrace}
+ {sessionRecordingEvents}
title="Last Event"
description="Details from the most recent occurrence of this exception"
/>
diff --git a/frontend/src/routes/issues/[exceptionHash]/[exceptionId]/+page.svelte b/frontend/src/routes/issues/[exceptionHash]/[exceptionId]/+page.svelte
index c75a4c52..47c5ce1d 100644
--- a/frontend/src/routes/issues/[exceptionHash]/[exceptionId]/+page.svelte
+++ b/frontend/src/routes/issues/[exceptionHash]/[exceptionId]/+page.svelte
@@ -26,6 +26,7 @@
let notFound = $state(false);
let total = $state(0);
let linkedTrace = $state<LinkedTrace | null>(null);
+ let sessionRecordingEvents = $state<unknown[] | null>(null);
let showArchiveDialog = $state(false);
let archiving = $state(false);
@@ -40,11 +41,13 @@
error = '';
notFound = false;
linkedTrace = null;
+ sessionRecordingEvents = null;
try {
// Load the specific exception by ID
const exceptionResponse = await api.post(`/exception-stack-traces/by-id/${data.exceptionId}`, {}, { projectId: projectsState.currentProjectId ?? undefined });
occurrence = exceptionResponse.exception;
+ sessionRecordingEvents = exceptionResponse.sessionRecordingEvents ?? null;
if (!occurrence) {
notFound = true;
@@ -172,6 +175,7 @@
<EventCard
{occurrence}
{linkedTrace}
+ {sessionRecordingEvents}
title="Event"
description="Details for this specific occurrence"
/>