Skip to content

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

feat: scope -> atributes rename

dduxe99848a30052
diff --git a/backend/app/controllers/endpoint_detail.controller.go b/backend/app/controllers/endpoint_detail.controller.go
index 364b8996..3b60966a 100644
--- a/backend/app/controllers/endpoint_detail.controller.go
+++ b/backend/app/controllers/endpoint_detail.controller.go
@@ -24,7 +24,7 @@ type EndpointMessageInfo struct {
ExceptionHash string `json:"exceptionHash"`
StackTrace string `json:"stackTrace"`
RecordedAt string `json:"recordedAt"`
- Scope map[string]string `json:"scope,omitempty"`
+ Attributes map[string]string `json:"attributes,omitempty"`
}
type EndpointDetailResponse struct {
@@ -86,7 +86,7 @@ func (t endpointDetailController) GetEndpointDetail(c *gin.Context) {
ExceptionHash: exc.ExceptionHash,
StackTrace: exc.StackTrace,
RecordedAt: exc.RecordedAt.Format("2006-01-02T15:04:05Z07:00"),
- Scope: exc.Scope,
+ Attributes: exc.Attributes,
})
} else if exceptionInfo == nil {
// Only take the first actual exception
diff --git a/backend/app/controllers/task_detail.controller.go b/backend/app/controllers/task_detail.controller.go
index d5bbc46b..77972668 100644
--- a/backend/app/controllers/task_detail.controller.go
+++ b/backend/app/controllers/task_detail.controller.go
@@ -24,7 +24,7 @@ type TaskMessageInfo struct {
ExceptionHash string `json:"exceptionHash"`
StackTrace string `json:"stackTrace"`
RecordedAt string `json:"recordedAt"`
- Scope map[string]string `json:"scope,omitempty"`
+ Attributes map[string]string `json:"attributes,omitempty"`
}
type TaskDetailResponse struct {
@@ -86,7 +86,7 @@ func (t taskDetailController) GetTaskDetail(c *gin.Context) {
ExceptionHash: exc.ExceptionHash,
StackTrace: exc.StackTrace,
RecordedAt: exc.RecordedAt.Format("2006-01-02T15:04:05Z07:00"),
- Scope: exc.Scope,
+ Attributes: exc.Attributes,
})
} else if exceptionInfo == nil {
// Only take the first actual exception
diff --git a/backend/app/migrations/ch/0013_rename_scope_to_attributes_endpoints.up.sql b/backend/app/migrations/ch/0013_rename_scope_to_attributes_endpoints.up.sql
new file mode 100644
index 00000000..4d47854d
--- /dev/null
+++ b/backend/app/migrations/ch/0013_rename_scope_to_attributes_endpoints.up.sql
@@ -0,0 +1 @@
+ALTER TABLE endpoints RENAME COLUMN scope TO attributes
diff --git a/backend/app/migrations/ch/0014_rename_scope_to_attributes_tasks.up.sql b/backend/app/migrations/ch/0014_rename_scope_to_attributes_tasks.up.sql
new file mode 100644
index 00000000..8c8b1417
--- /dev/null
+++ b/backend/app/migrations/ch/0014_rename_scope_to_attributes_tasks.up.sql
@@ -0,0 +1 @@
+ALTER TABLE tasks RENAME COLUMN scope TO attributes
diff --git a/backend/app/migrations/ch/0015_rename_scope_to_attributes_exception_stack_traces.up.sql b/backend/app/migrations/ch/0015_rename_scope_to_attributes_exception_stack_traces.up.sql
new file mode 100644
index 00000000..03267aa2
--- /dev/null
+++ b/backend/app/migrations/ch/0015_rename_scope_to_attributes_exception_stack_traces.up.sql
@@ -0,0 +1 @@
+ALTER TABLE exception_stack_traces RENAME COLUMN scope TO attributes
diff --git a/backend/app/migrations/ch/0016_rename_scope_to_attributes_transactions.up.sql b/backend/app/migrations/ch/0016_rename_scope_to_attributes_transactions.up.sql
new file mode 100644
index 00000000..32cdcec7
--- /dev/null
+++ b/backend/app/migrations/ch/0016_rename_scope_to_attributes_transactions.up.sql
@@ -0,0 +1 @@
+ALTER TABLE transactions RENAME COLUMN scope TO attributes
diff --git a/backend/app/models/clientmodels/clientmodels.model.go b/backend/app/models/clientmodels/clientmodels.model.go
index 69aae286..de6ee1b1 100644
--- a/backend/app/models/clientmodels/clientmodels.model.go
+++ b/backend/app/models/clientmodels/clientmodels.model.go
@@ -12,7 +12,7 @@ type ClientExceptionStackTrace struct {
IsTask bool `json:"isTask"`
StackTrace string `json:"stackTrace"`
RecordedAt time.Time `json:"recordedAt"`
- Scope map[string]string `json:"scope"`
+ Attributes map[string]string `json:"attributes"`
IsMessage bool `json:"isMessage"`
}
@@ -35,7 +35,7 @@ func (c *ClientExceptionStackTrace) ToExceptionStackTrace(exceptionHash, appVers
TraceType: traceType,
StackTrace: c.StackTrace,
RecordedAt: c.RecordedAt,
- Scope: c.Scope,
+ Attributes: c.Attributes,
IsMessage: c.IsMessage,
AppVersion: appVersion,
ServerName: serverName,
@@ -65,7 +65,7 @@ type ClientTrace struct {
StatusCode int `json:"statusCode"`
BodySize int `json:"bodySize"`
ClientIP string `json:"clientIP"`
- Scope map[string]string `json:"scope"`
+ Attributes map[string]string `json:"attributes"`
Spans []*ClientSpan `json:"spans"`
IsTask bool `json:"isTask"`
}
@@ -87,7 +87,7 @@ func (c *ClientTrace) ToEndpoint(appVersion, serverName string) models.Endpoint
StatusCode: int16(c.StatusCode),
BodySize: int32(c.BodySize),
ClientIP: c.ClientIP,
- Scope: c.Scope,
+ Attributes: c.Attributes,
AppVersion: appVersion,
ServerName: serverName,
}
@@ -96,11 +96,11 @@ func (c *ClientTrace) ToEndpoint(appVersion, serverName string) models.Endpoint
func (c *ClientTrace) ToTask(appVersion, serverName string) models.Task {
return models.Task{
Id: c.ParsedId(),
- TaskName: c.Endpoint, // Endpoint field is used as task name
+ TaskName: c.Endpoint,
Duration: c.Duration,
RecordedAt: c.RecordedAt,
ClientIP: c.ClientIP,
- Scope: c.Scope,
+ Attributes: c.Attributes,
AppVersion: appVersion,
ServerName: serverName,
}
diff --git a/backend/app/models/endpoint.model.go b/backend/app/models/endpoint.model.go
index 7d5f4ae3..09add3ca 100644
--- a/backend/app/models/endpoint.model.go
+++ b/backend/app/models/endpoint.model.go
@@ -16,7 +16,7 @@ type Endpoint struct {
StatusCode int16 `json:"statusCode" ch:"status_code"`
BodySize int32 `json:"bodySize" ch:"body_size"`
ClientIP string `json:"clientIP" ch:"client_ip"`
- Scope map[string]string `json:"scope" ch:"scope"`
+ Attributes map[string]string `json:"attributes" ch:"attributes"`
AppVersion string `json:"appVersion" ch:"app_version"`
ServerName string `json:"serverName" ch:"server_name"`
}
diff --git a/backend/app/models/exception_stack_trace.model.go b/backend/app/models/exception_stack_trace.model.go
index f2ce141b..86814188 100644
--- a/backend/app/models/exception_stack_trace.model.go
+++ b/backend/app/models/exception_stack_trace.model.go
@@ -14,7 +14,7 @@ type ExceptionStackTrace struct {
ExceptionHash string `json:"exceptionHash" ch:"exception_hash"`
StackTrace string `json:"stackTrace" ch:"stack_trace"`
RecordedAt time.Time `json:"recordedAt" ch:"recorded_at"`
- Scope map[string]string `json:"scope" ch:"scope"`
+ Attributes map[string]string `json:"attributes" ch:"attributes"`
AppVersion string `json:"appVersion" ch:"app_version"`
ServerName string `json:"serverName" ch:"server_name"`
IsMessage bool `json:"isMessage" ch:"is_message"`
diff --git a/backend/app/models/task.model.go b/backend/app/models/task.model.go
index 855d1c7d..16f5876e 100644
--- a/backend/app/models/task.model.go
+++ b/backend/app/models/task.model.go
@@ -13,7 +13,7 @@ type Task struct {
Duration time.Duration `json:"duration" ch:"duration"`
RecordedAt time.Time `json:"recordedAt" ch:"recorded_at"`
ClientIP string `json:"clientIP" ch:"client_ip"`
- Scope map[string]string `json:"scope" ch:"scope"`
+ Attributes map[string]string `json:"attributes" ch:"attributes"`
AppVersion string `json:"appVersion" ch:"app_version"`
ServerName string `json:"serverName" ch:"server_name"`
}
diff --git a/backend/app/repositories/endpoint.repository.go b/backend/app/repositories/endpoint.repository.go
index dc757b4d..ae6b28da 100644
--- a/backend/app/repositories/endpoint.repository.go
+++ b/backend/app/repositories/endpoint.repository.go
@@ -16,18 +16,18 @@ import (
type endpointRepository struct{}
func (e *endpointRepository) InsertAsync(ctx context.Context, lines []models.Endpoint) error {
- batch, err := (*chdb.Conn).PrepareBatch(clickhouse.Context(context.Background(), clickhouse.WithAsync(false)), "INSERT INTO endpoints (id, project_id, endpoint, duration, recorded_at, status_code, body_size, client_ip, scope, app_version, server_name)")
+ batch, err := (*chdb.Conn).PrepareBatch(clickhouse.Context(context.Background(), clickhouse.WithAsync(false)), "INSERT INTO endpoints (id, project_id, endpoint, duration, recorded_at, status_code, body_size, client_ip, attributes, app_version, server_name)")
if err != nil {
return err
}
for _, t := range lines {
- scopeJSON := "{}"
- if len(t.Scope) != 0 {
- if scopeBytes, err := json.Marshal(t.Scope); err == nil {
- scopeJSON = string(scopeBytes)
+ attributesJSON := "{}"
+ if len(t.Attributes) != 0 {
+ if attributesBytes, err := json.Marshal(t.Attributes); err == nil {
+ attributesJSON = string(attributesBytes)
}
}
- if err := batch.Append(t.Id, t.ProjectId, t.Endpoint, t.Duration, t.RecordedAt, t.StatusCode, t.BodySize, t.ClientIP, scopeJSON, t.AppVersion, t.ServerName); err != nil {
+ if err := batch.Append(t.Id, t.ProjectId, t.Endpoint, t.Duration, t.RecordedAt, t.StatusCode, t.BodySize, t.ClientIP, attributesJSON, t.AppVersion, t.ServerName); err != nil {
return err
}
}
@@ -60,7 +60,7 @@ func (e *endpointRepository) FindAll(ctx context.Context, projectId uuid.UUID, f
orderBy = "recorded_at"
}
- query := "SELECT id, project_id, endpoint, duration, recorded_at, status_code, body_size, client_ip, scope, app_version, server_name FROM endpoints WHERE project_id = ? AND recorded_at >= ? AND recorded_at <= ? ORDER BY " + orderBy + " DESC LIMIT ? OFFSET ?"
+ query := "SELECT id, project_id, endpoint, duration, recorded_at, status_code, body_size, client_ip, attributes, app_version, server_name FROM endpoints WHERE project_id = ? AND recorded_at >= ? AND recorded_at <= ? ORDER BY " + orderBy + " DESC LIMIT ? OFFSET ?"
rows, err := (*chdb.Conn).Query(ctx, query, projectId, fromDate, toDate, pageSize, offset)
if err != nil {
return nil, 0, err
@@ -70,13 +70,13 @@ func (e *endpointRepository) FindAll(ctx context.Context, projectId uuid.UUID, f
var endpoints []models.Endpoint
for rows.Next() {
var t models.Endpoint
- var scopeJSON string
- if err := rows.Scan(&t.Id, &t.ProjectId, &t.Endpoint, &t.Duration, &t.RecordedAt, &t.StatusCode, &t.BodySize, &t.ClientIP, &scopeJSON, &t.AppVersion, &t.ServerName); err != nil {
+ var attributesJSON string
+ if err := rows.Scan(&t.Id, &t.ProjectId, &t.Endpoint, &t.Duration, &t.RecordedAt, &t.StatusCode, &t.BodySize, &t.ClientIP, &attributesJSON, &t.AppVersion, &t.ServerName); err != nil {
return nil, 0, err
}
- if scopeJSON != "" && scopeJSON != "{}" {
- if err := json.Unmarshal([]byte(scopeJSON), &t.Scope); err != nil {
- t.Scope = nil
+ if attributesJSON != "" && attributesJSON != "{}" {
+ if err := json.Unmarshal([]byte(attributesJSON), &t.Attributes); err != nil {
+ t.Attributes = nil
}
}
endpoints = append(endpoints, t)
@@ -200,7 +200,7 @@ func (e *endpointRepository) FindByEndpoint(ctx context.Context, projectId uuid.
sortDir = "ASC"
}
- query := "SELECT id, project_id, endpoint, duration, recorded_at, status_code, body_size, client_ip, scope, app_version, server_name FROM endpoints WHERE project_id = ? AND endpoint = ? AND recorded_at >= ? AND recorded_at <= ? ORDER BY " + orderBy + " " + sortDir + " LIMIT ? OFFSET ?"
+ query := "SELECT id, project_id, endpoint, duration, recorded_at, status_code, body_size, client_ip, attributes, app_version, server_name FROM endpoints WHERE project_id = ? AND endpoint = ? AND recorded_at >= ? AND recorded_at <= ? ORDER BY " + orderBy + " " + sortDir + " LIMIT ? OFFSET ?"
rows, err := (*chdb.Conn).Query(ctx, query, projectId, endpoint, fromDate, toDate, pageSize, offset)
if err != nil {
return nil, 0, err
@@ -210,13 +210,13 @@ func (e *endpointRepository) FindByEndpoint(ctx context.Context, projectId uuid.
var endpoints []models.Endpoint
for rows.Next() {
var t models.Endpoint
- var scopeJSON string
- if err := rows.Scan(&t.Id, &t.ProjectId, &t.Endpoint, &t.Duration, &t.RecordedAt, &t.StatusCode, &t.BodySize, &t.ClientIP, &scopeJSON, &t.AppVersion, &t.ServerName); err != nil {
+ var attributesJSON string
+ if err := rows.Scan(&t.Id, &t.ProjectId, &t.Endpoint, &t.Duration, &t.RecordedAt, &t.StatusCode, &t.BodySize, &t.ClientIP, &attributesJSON, &t.AppVersion, &t.ServerName); err != nil {
return nil, 0, err
}
- if scopeJSON != "" && scopeJSON != "{}" {
- if err := json.Unmarshal([]byte(scopeJSON), &t.Scope); err != nil {
- t.Scope = nil
+ if attributesJSON != "" && attributesJSON != "{}" {
+ if err := json.Unmarshal([]byte(attributesJSON), &t.Attributes); err != nil {
+ t.Attributes = nil
}
}
endpoints = append(endpoints, t)
@@ -227,17 +227,17 @@ func (e *endpointRepository) FindByEndpoint(ctx context.Context, projectId uuid.
// FindById returns a single endpoint by ID
func (e *endpointRepository) FindById(ctx context.Context, projectId, endpointId uuid.UUID) (*models.Endpoint, error) {
- query := `SELECT id, project_id, endpoint, duration, recorded_at, status_code, body_size, client_ip, scope, app_version, server_name
+ query := `SELECT id, project_id, endpoint, duration, recorded_at, status_code, body_size, client_ip, attributes, app_version, server_name
FROM endpoints
WHERE project_id = ? AND id = ?
LIMIT 1`
var t models.Endpoint
- var scopeJSON string
+ var attributesJSON string
err := (*chdb.Conn).QueryRow(ctx, query, projectId, endpointId).Scan(
&t.Id, &t.ProjectId, &t.Endpoint, &t.Duration, &t.RecordedAt,
- &t.StatusCode, &t.BodySize, &t.ClientIP, &scopeJSON, &t.AppVersion, &t.ServerName)
+ &t.StatusCode, &t.BodySize, &t.ClientIP, &attributesJSON, &t.AppVersion, &t.ServerName)
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
@@ -246,9 +246,9 @@ func (e *endpointRepository) FindById(ctx context.Context, projectId, endpointId
return nil, err
}
- if scopeJSON != "" && scopeJSON != "{}" {
- if err := json.Unmarshal([]byte(scopeJSON), &t.Scope); err != nil {
- t.Scope = nil
+ if attributesJSON != "" && attributesJSON != "{}" {
+ if err := json.Unmarshal([]byte(attributesJSON), &t.Attributes); err != nil {
+ t.Attributes = nil
}
}
diff --git a/backend/app/repositories/exception_stack_trace.repository.go b/backend/app/repositories/exception_stack_trace.repository.go
index 1831d03a..d5ceee23 100644
--- a/backend/app/repositories/exception_stack_trace.repository.go
+++ b/backend/app/repositories/exception_stack_trace.repository.go
@@ -17,15 +17,15 @@ import (
type exceptionStackTraceRepository struct{}
func (e *exceptionStackTraceRepository) InsertAsync(ctx context.Context, lines []models.ExceptionStackTrace) error {
- batch, err := (*chdb.Conn).PrepareBatch(clickhouse.Context(context.Background(), clickhouse.WithAsync(false)), "INSERT INTO exception_stack_traces (id, project_id, trace_id, trace_type, exception_hash, stack_trace, recorded_at, scope, app_version, server_name, is_message)")
+ batch, err := (*chdb.Conn).PrepareBatch(clickhouse.Context(context.Background(), clickhouse.WithAsync(false)), "INSERT INTO exception_stack_traces (id, project_id, trace_id, trace_type, exception_hash, stack_trace, recorded_at, attributes, app_version, server_name, is_message)")
if err != nil {
return err
}
for _, est := range lines {
- scopeJSON := "{}"
- if len(est.Scope) != 0 {
- if scopeBytes, err := json.Marshal(est.Scope); err == nil {
- scopeJSON = string(scopeBytes)
+ attributesJSON := "{}"
+ if len(est.Attributes) != 0 {
+ if attributesBytes, err := json.Marshal(est.Attributes); err == nil {
+ attributesJSON = string(attributesBytes)
}
}
isMessage := uint8(0)
@@ -36,7 +36,7 @@ func (e *exceptionStackTraceRepository) InsertAsync(ctx context.Context, lines [
if traceType == "" {
traceType = "endpoint"
}
- if err := batch.Append(est.Id, est.ProjectId, est.TraceId, traceType, est.ExceptionHash, est.StackTrace, est.RecordedAt, scopeJSON, est.AppVersion, est.ServerName, isMessage); err != nil {
+ if err := batch.Append(est.Id, est.ProjectId, est.TraceId, traceType, est.ExceptionHash, est.StackTrace, est.RecordedAt, attributesJSON, est.AppVersion, est.ServerName, isMessage); err != nil {
return err
}
}
@@ -159,9 +159,8 @@ func (e *exceptionStackTraceRepository) FindByHash(ctx context.Context, projectI
return nil, nil, 0, err
}
- // Get individual occurrences with pagination (including scope)
rows, err := (*chdb.Conn).Query(ctx,
- "SELECT id, project_id, trace_id, trace_type, exception_hash, stack_trace, recorded_at, scope, app_version, server_name, is_message FROM exception_stack_traces WHERE project_id = ? AND exception_hash = ? ORDER BY recorded_at DESC LIMIT ? OFFSET ?",
+ "SELECT id, project_id, trace_id, trace_type, exception_hash, stack_trace, recorded_at, attributes, app_version, server_name, is_message FROM exception_stack_traces WHERE project_id = ? AND exception_hash = ? ORDER BY recorded_at DESC LIMIT ? OFFSET ?",
projectId, exceptionHash, pageSize, offset)
if err != nil {
return nil, nil, 0, err
@@ -171,15 +170,15 @@ func (e *exceptionStackTraceRepository) FindByHash(ctx context.Context, projectI
var occurrences []models.ExceptionStackTrace
for rows.Next() {
var o models.ExceptionStackTrace
- var scopeJSON string
+ var attributesJSON string
var isMessage uint8
- if err := rows.Scan(&o.Id, &o.ProjectId, &o.TraceId, &o.TraceType, &o.ExceptionHash, &o.StackTrace, &o.RecordedAt, &scopeJSON, &o.AppVersion, &o.ServerName, &isMessage); err != nil {
+ if err := rows.Scan(&o.Id, &o.ProjectId, &o.TraceId, &o.TraceType, &o.ExceptionHash, &o.StackTrace, &o.RecordedAt, &attributesJSON, &o.AppVersion, &o.ServerName, &isMessage); err != nil {
return nil, nil, 0, err
}
o.IsMessage = isMessage == 1
- if scopeJSON != "" && scopeJSON != "{}" {
- if err := json.Unmarshal([]byte(scopeJSON), &o.Scope); err != nil {
- o.Scope = nil // If parsing fails, leave scope as nil
+ if attributesJSON != "" && attributesJSON != "{}" {
+ if err := json.Unmarshal([]byte(attributesJSON), &o.Attributes); err != nil {
+ o.Attributes = nil // If parsing fails, leave attributes as nil
}
}
occurrences = append(occurrences, o)
@@ -323,17 +322,17 @@ func (e *exceptionStackTraceRepository) IsArchived(ctx context.Context, projectI
func (e *exceptionStackTraceRepository) FindExceptionByTraceId(ctx context.Context, projectId uuid.UUID, traceId uuid.UUID) (*models.ExceptionStackTrace, error) {
var est models.ExceptionStackTrace
- var scopeJSON string
+ var attributesJSON string
var isMessage uint8
err := (*chdb.Conn).QueryRow(ctx,
- `SELECT id, project_id, trace_id, trace_type, exception_hash, stack_trace, recorded_at, scope, app_version, server_name, is_message
+ `SELECT id, project_id, trace_id, trace_type, exception_hash, stack_trace, recorded_at, attributes, app_version, server_name, is_message
FROM exception_stack_traces
WHERE project_id = ? AND trace_id = ? AND is_message = false
LIMIT 1`,
projectId, traceId).Scan(
&est.Id, &est.ProjectId, &est.TraceId, &est.TraceType, &est.ExceptionHash, &est.StackTrace,
- &est.RecordedAt, &scopeJSON, &est.AppVersion, &est.ServerName, &isMessage)
+ &est.RecordedAt, &attributesJSON, &est.AppVersion, &est.ServerName, &isMessage)
if err != nil {
// No exception found for this trace
@@ -341,9 +340,9 @@ func (e *exceptionStackTraceRepository) FindExceptionByTraceId(ctx context.Conte
}
est.IsMessage = isMessage == 1
- if scopeJSON != "" && scopeJSON != "{}" {
- if err := json.Unmarshal([]byte(scopeJSON), &est.Scope); err != nil {
- est.Scope = nil
+ if attributesJSON != "" && attributesJSON != "{}" {
+ if err := json.Unmarshal([]byte(attributesJSON), &est.Attributes); err != nil {
+ est.Attributes = nil
}
}
@@ -353,7 +352,7 @@ func (e *exceptionStackTraceRepository) FindExceptionByTraceId(ctx context.Conte
// FindAllByTraceId returns all exceptions and messages associated with a specific trace
func (e *exceptionStackTraceRepository) FindAllByTraceId(ctx context.Context, projectId uuid.UUID, traceId uuid.UUID) ([]models.ExceptionStackTrace, error) {
rows, err := (*chdb.Conn).Query(ctx,
- `SELECT id, project_id, trace_id, trace_type, exception_hash, stack_trace, recorded_at, scope, app_version, server_name, is_message
+ `SELECT id, project_id, trace_id, trace_type, exception_hash, stack_trace, recorded_at, attributes, app_version, server_name, is_message
FROM exception_stack_traces
WHERE project_id = ? AND trace_id = ?
ORDER BY recorded_at ASC`,
@@ -367,18 +366,18 @@ func (e *exceptionStackTraceRepository) FindAllByTraceId(ctx context.Context, pr
var results []models.ExceptionStackTrace
for rows.Next() {
var est models.ExceptionStackTrace
- var scopeJSON string
+ var attributesJSON string
var isMessage uint8
if err := rows.Scan(&est.Id, &est.ProjectId, &est.TraceId, &est.TraceType, &est.ExceptionHash, &est.StackTrace,
- &est.RecordedAt, &scopeJSON, &est.AppVersion, &est.ServerName, &isMessage); err != nil {
+ &est.RecordedAt, &attributesJSON, &est.AppVersion, &est.ServerName, &isMessage); err != nil {
return nil, err
}
est.IsMessage = isMessage == 1
- if scopeJSON != "" && scopeJSON != "{}" {
- if err := json.Unmarshal([]byte(scopeJSON), &est.Scope); err != nil {
- est.Scope = nil
+ if attributesJSON != "" && attributesJSON != "{}" {
+ if err := json.Unmarshal([]byte(attributesJSON), &est.Attributes); err != nil {
+ est.Attributes = nil
}
}
results = append(results, est)
@@ -390,17 +389,17 @@ func (e *exceptionStackTraceRepository) FindAllByTraceId(ctx context.Context, pr
// FindById returns a single exception by its ID
func (e *exceptionStackTraceRepository) FindById(ctx context.Context, projectId uuid.UUID, id uuid.UUID) (*models.ExceptionStackTrace, error) {
var est models.ExceptionStackTrace
- var scopeJSON string
+ var attributesJSON string
var isMessage uint8
err := (*chdb.Conn).QueryRow(ctx,
- `SELECT id, project_id, trace_id, trace_type, exception_hash, stack_trace, recorded_at, scope, app_version, server_name, is_message
+ `SELECT id, project_id, trace_id, trace_type, exception_hash, stack_trace, recorded_at, attributes, app_version, server_name, is_message
FROM exception_stack_traces
WHERE project_id = ? AND id = ?
LIMIT 1`,
projectId, id).Scan(
&est.Id, &est.ProjectId, &est.TraceId, &est.TraceType, &est.ExceptionHash, &est.StackTrace,
- &est.RecordedAt, &scopeJSON, &est.AppVersion, &est.ServerName, &isMessage)
+ &est.RecordedAt, &attributesJSON, &est.AppVersion, &est.ServerName, &isMessage)
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
@@ -410,9 +409,9 @@ func (e *exceptionStackTraceRepository) FindById(ctx context.Context, projectId
}
est.IsMessage = isMessage == 1
- if scopeJSON != "" && scopeJSON != "{}" {
- if err := json.Unmarshal([]byte(scopeJSON), &est.Scope); err != nil {
- est.Scope = nil
+ if attributesJSON != "" && attributesJSON != "{}" {
+ if err := json.Unmarshal([]byte(attributesJSON), &est.Attributes); err != nil {
+ est.Attributes = nil
}
}
diff --git a/backend/app/repositories/task.repository.go b/backend/app/repositories/task.repository.go
index bc136959..8e6758db 100644
--- a/backend/app/repositories/task.repository.go
+++ b/backend/app/repositories/task.repository.go
@@ -16,18 +16,18 @@ import (
type taskRepository struct{}
func (e *taskRepository) InsertAsync(ctx context.Context, lines []models.Task) error {
- batch, err := (*chdb.Conn).PrepareBatch(clickhouse.Context(context.Background(), clickhouse.WithAsync(false)), "INSERT INTO tasks (id, project_id, task_name, duration, recorded_at, client_ip, scope, app_version, server_name)")
+ batch, err := (*chdb.Conn).PrepareBatch(clickhouse.Context(context.Background(), clickhouse.WithAsync(false)), "INSERT INTO tasks (id, project_id, task_name, duration, recorded_at, client_ip, attributes, app_version, server_name)")
if err != nil {
return err
}
for _, t := range lines {
- scopeJSON := "{}"
- if len(t.Scope) != 0 {
- if scopeBytes, err := json.Marshal(t.Scope); err == nil {
- scopeJSON = string(scopeBytes)
+ attributesJSON := "{}"
+ if len(t.Attributes) != 0 {
+ if attributesBytes, err := json.Marshal(t.Attributes); err == nil {
+ attributesJSON = string(attributesBytes)
}
}
- if err := batch.Append(t.Id, t.ProjectId, t.TaskName, t.Duration, t.RecordedAt, t.ClientIP, scopeJSON, t.AppVersion, t.ServerName); err != nil {
+ if err := batch.Append(t.Id, t.ProjectId, t.TaskName, t.Duration, t.RecordedAt, t.ClientIP, attributesJSON, t.AppVersion, t.ServerName); err != nil {
return err
}
}
@@ -58,7 +58,7 @@ func (e *taskRepository) FindAll(ctx context.Context, projectId uuid.UUID, fromD
orderBy = "recorded_at"
}
- query := "SELECT id, project_id, task_name, duration, recorded_at, client_ip, scope, app_version, server_name FROM tasks WHERE project_id = ? AND recorded_at >= ? AND recorded_at <= ? ORDER BY " + orderBy + " DESC LIMIT ? OFFSET ?"
+ query := "SELECT id, project_id, task_name, duration, recorded_at, client_ip, attributes, app_version, server_name FROM tasks WHERE project_id = ? AND recorded_at >= ? AND recorded_at <= ? ORDER BY " + orderBy + " DESC LIMIT ? OFFSET ?"
rows, err := (*chdb.Conn).Query(ctx, query, projectId, fromDate, toDate, pageSize, offset)
if err != nil {
return nil, 0, err
@@ -68,13 +68,13 @@ func (e *taskRepository) FindAll(ctx context.Context, projectId uuid.UUID, fromD
var tasks []models.Task
for rows.Next() {
var t models.Task
- var scopeJSON string
- if err := rows.Scan(&t.Id, &t.ProjectId, &t.TaskName, &t.Duration, &t.RecordedAt, &t.ClientIP, &scopeJSON, &t.AppVersion, &t.ServerName); err != nil {
+ var attributesJSON string
+ if err := rows.Scan(&t.Id, &t.ProjectId, &t.TaskName, &t.Duration, &t.RecordedAt, &t.ClientIP, &attributesJSON, &t.AppVersion, &t.ServerName); err != nil {
return nil, 0, err
}
- if scopeJSON != "" && scopeJSON != "{}" {
- if err := json.Unmarshal([]byte(scopeJSON), &t.Scope); err != nil {
- t.Scope = nil
+ if attributesJSON != "" && attributesJSON != "{}" {
+ if err := json.Unmarshal([]byte(attributesJSON), &t.Attributes); err != nil {
+ t.Attributes = nil
}
}
tasks = append(tasks, t)
@@ -173,7 +173,7 @@ func (e *taskRepository) FindByTaskName(ctx context.Context, projectId uuid.UUID
sortDir = "ASC"
}
- query := "SELECT id, project_id, task_name, duration, recorded_at, client_ip, scope, app_version, server_name FROM tasks WHERE project_id = ? AND task_name = ? AND recorded_at >= ? AND recorded_at <= ? ORDER BY " + orderBy + " " + sortDir + " LIMIT ? OFFSET ?"
+ query := "SELECT id, project_id, task_name, duration, recorded_at, client_ip, attributes, app_version, server_name FROM tasks WHERE project_id = ? AND task_name = ? AND recorded_at >= ? AND recorded_at <= ? ORDER BY " + orderBy + " " + sortDir + " LIMIT ? OFFSET ?"
rows, err := (*chdb.Conn).Query(ctx, query, projectId, taskName, fromDate, toDate, pageSize, offset)
if err != nil {
return nil, 0, err
@@ -183,13 +183,13 @@ func (e *taskRepository) FindByTaskName(ctx context.Context, projectId uuid.UUID
var tasks []models.Task
for rows.Next() {
var t models.Task
- var scopeJSON string
- if err := rows.Scan(&t.Id, &t.ProjectId, &t.TaskName, &t.Duration, &t.RecordedAt, &t.ClientIP, &scopeJSON, &t.AppVersion, &t.ServerName); err != nil {
+ var attributesJSON string
+ if err := rows.Scan(&t.Id, &t.ProjectId, &t.TaskName, &t.Duration, &t.RecordedAt, &t.ClientIP, &attributesJSON, &t.AppVersion, &t.ServerName); err != nil {
return nil, 0, err
}
- if scopeJSON != "" && scopeJSON != "{}" {
- if err := json.Unmarshal([]byte(scopeJSON), &t.Scope); err != nil {
- t.Scope = nil
+ if attributesJSON != "" && attributesJSON != "{}" {
+ if err := json.Unmarshal([]byte(attributesJSON), &t.Attributes); err != nil {
+ t.Attributes = nil
}
}
tasks = append(tasks, t)
@@ -200,17 +200,17 @@ func (e *taskRepository) FindByTaskName(ctx context.Context, projectId uuid.UUID
// FindById returns a single task by ID
func (e *taskRepository) FindById(ctx context.Context, projectId, taskId uuid.UUID) (*models.Task, error) {
- query := `SELECT id, project_id, task_name, duration, recorded_at, client_ip, scope, app_version, server_name
+ query := `SELECT id, project_id, task_name, duration, recorded_at, client_ip, attributes, app_version, server_name
FROM tasks
WHERE project_id = ? AND id = ?
LIMIT 1`
var t models.Task
- var scopeJSON string
+ var attributesJSON string
err := (*chdb.Conn).QueryRow(ctx, query, projectId, taskId).Scan(
&t.Id, &t.ProjectId, &t.TaskName, &t.Duration, &t.RecordedAt,
- &t.ClientIP, &scopeJSON, &t.AppVersion, &t.ServerName)
+ &t.ClientIP, &attributesJSON, &t.AppVersion, &t.ServerName)
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
@@ -219,9 +219,9 @@ func (e *taskRepository) FindById(ctx context.Context, projectId, taskId uuid.UU
return nil, err
}
- if scopeJSON != "" && scopeJSON != "{}" {
- if err := json.Unmarshal([]byte(scopeJSON), &t.Scope); err != nil {
- t.Scope = nil
+ if attributesJSON != "" && attributesJSON != "{}" {
+ if err := json.Unmarshal([]byte(attributesJSON), &t.Attributes); err != nil {
+ t.Attributes = nil
}
}
diff --git a/docs/pages/getting-started/go-client.mdx b/docs/pages/getting-started/go-client.mdx
index f76ec386..b4dc0bb9 100644
--- a/docs/pages/getting-started/go-client.mdx
+++ b/docs/pages/getting-started/go-client.mdx
@@ -67,7 +67,7 @@ This design minimizes network overhead and handles temporary connectivity issues
## Next Steps
-- [Main Concepts](/getting-started/main-concepts) - Understand Endpoints, Issues, Tasks, Metrics, and Scope
+- [Main Concepts](/getting-started/main-concepts) - Understand Endpoints, Issues, Tasks, Metrics, and Attributes
- [Gin Framework](/go-client/gin/quickstart) - Quick start guide for Gin integration
-- [Scope](/go-client/scope) - Add contextual tags to your telemetry
+- [Attributes](/go-client/attributes) - Add contextual tags to your telemetry
- [Segments](/go-client/segments) - Track sub-operations within transactions
diff --git a/docs/pages/getting-started/main-concepts.mdx b/docs/pages/getting-started/main-concepts.mdx
index 33b9bfc4..66b53896 100644
--- a/docs/pages/getting-started/main-concepts.mdx
+++ b/docs/pages/getting-started/main-concepts.mdx
@@ -1,6 +1,6 @@
# Main Concepts
-Traceway organizes your application telemetry into five core concepts: Endpoints, Issues, Tasks, Metrics, and Scope. Understanding these concepts will help you get the most out of your monitoring setup.
+Traceway organizes your application telemetry into five core concepts: Endpoints, Issues, Tasks, Metrics, and Attributes. Understanding these concepts will help you get the most out of your monitoring setup.
## Endpoints
@@ -8,7 +8,7 @@ Endpoints represent HTTP transactions in your application. Each endpoint is iden
## Issues
-Issues are exceptions (errors and panics) captured from your application as well as messages. Traceway automatically groups similar exceptions so the same logical error appears as one issue. Issues can contain their own Scope and they can be connected to a transaction or a task.
+Issues are exceptions (errors and panics) captured from your application as well as messages. Traceway automatically groups similar exceptions so the same logical error appears as one issue. Issues can contain their own Attributes and they can be connected to a transaction or a task.
### Error vs Message
@@ -17,7 +17,7 @@ Traceway captures two types of exceptions:
- **Errors** - Runtime exceptions with stack traces (panics, thrown errors)
- **Messages** - Explicitly captured errors via `traceway.CaptureMessage("a string with some value")`
-Both appear in the Issues list with full context/scope.
+Both appear in the Issues list with full context.
### Automatic Grouping
@@ -35,10 +35,10 @@ This means the same bug produces one issue, not thousands of duplicates with dif
2. **Archived** - Marked as resolved by you (doesn't show up until it's reopened)
3. **Reopened** - Archived issue that occurred again (regression)
-## Context/Scope Tags
+## Context Tags
-Scope can be captured on Enpoints/Issues/Tasks.
-It's a map of key value pairs that gives you extra context related to the instance you are reviewing.
+Attributes can be captured on Endpoints/Issues/Tasks.
+They are a map of key value pairs that give you extra context related to the instance you are reviewing.
If the value is JSON it will be displayed formatted on the website.
Tags help you understand who was affected and what they were doing.
@@ -105,9 +105,9 @@ Custom metrics are currently not being displayed on the website.
Here's how the concepts connect in a typical request flow:
1. **Request arrives** → Creates a new transaction (Endpoint)
-2. **Auth middleware runs** → Adds user_id to Scope
+2. **Auth middleware runs** → Adds user_id to Attributes
3. **Handler executes** → May create Segments for sub-operations
-4. **Error occurs** → Issue captured with full Scope context
+4. **Error occurs** → Issue captured with full Attributes context
5. **Request completes** → Transaction recorded with duration
6. **Background** → Metrics collected every 30 seconds
7. **Tasks** → Capture all async (outside of the endpoints) code execution into Tasks
@@ -122,4 +122,4 @@ All this data flows to your Traceway dashboard where you can:
## Next Steps
- [Go Client Quickstart](/go-client/gin/quickstart) - Set up the SDK
-- [Scope Documentation](/go-client/scope) - Deep dive into scope
+- [Attributes Documentation](/go-client/attributes) - Deep dive into attributes
diff --git a/docs/pages/go-client/_meta.json b/docs/pages/go-client/_meta.json
index 480e3fc7..913509fe 100644
--- a/docs/pages/go-client/_meta.json
+++ b/docs/pages/go-client/_meta.json
@@ -1,5 +1,5 @@
{
"gin": "Gin Framework",
- "scope": "Scope",
+ "attributes": "Attributes",
"segments": "Segments"
}
diff --git a/docs/pages/go-client/scope.mdx b/docs/pages/go-client/attributes.mdx
similarity index 55%
rename from docs/pages/go-client/scope.mdx
rename to docs/pages/go-client/attributes.mdx
index 9bc8c478..4ff78576 100644
--- a/docs/pages/go-client/scope.mdx
+++ b/docs/pages/go-client/attributes.mdx
@@ -1,8 +1,8 @@
-# Scope
+# Attributes
-Scopes attach contextual tags to exceptions and transactions, making it easier to debug and filter issues in the dashboard.
+Attributes attach contextual tags to exceptions and transactions, making it easier to debug and filter issues in the dashboard.
-## Request Scope
+## Request Attributes
Add contextual information specific to a single request:
@@ -10,25 +10,24 @@ Add contextual information specific to a single request:
import tracewaygin "github.com/tracewayapp/go-client/traceway_gin"
func handler(c *gin.Context) {
- // Get the request-scoped scope
- scope := tracewaygin.GetScope(c)
+ attributes := tracewaygin.GetAttributesFromGin(c)
// Add tags that will be attached to any exceptions in this request
- scope.SetTag("user_id", c.Param("id"))
- scope.SetTag("tenant", "acme-corp")
- scope.SetTag("feature_flag", "new_checkout")
+ attributes.SetTag("user_id", c.Param("id"))
+ attributes.SetTag("tenant", "acme-corp")
+ attributes.SetTag("feature_flag", "new_checkout")
// ... rest of handler
}
```
-Request scope tags are automatically included when:
+Request attribute tags are automatically included when:
- Exceptions are captured during the request
- The transaction is recorded
- Segments are tracked
-## Scope Methods
+## Attributes Methods
| Method | Description |
| ----------------------------------- | ---------------------------------------------- |
@@ -41,19 +40,19 @@ Request scope tags are automatically included when:
```go
// String tags
-scope.SetTag("user_id", "12345")
-scope.SetTag("organization", "acme-corp")
+attributes.SetTag("user_id", "12345")
+attributes.SetTag("organization", "acme-corp")
// JSON tags for complex values
-scope.SetTagJson("cart_items", []string{"item1", "item2", "item3"})
-scope.SetTagJson("user_prefs", map[string]bool{"notifications": true})
+attributes.SetTagJson("cart_items", []string{"item1", "item2", "item3"})
+attributes.SetTagJson("user_prefs", map[string]bool{"notifications": true})
// Reading tags
-userID := scope.GetTag("user_id")
-allTags := scope.GetTags()
+userID := attributes.GetTag("user_id")
+allTags := attributes.GetTags()
```
-## Scope in Middleware
+## Attributes in Middleware
Add tags for all requests in a middleware function:
@@ -62,28 +61,28 @@ func authMiddleware() gin.HandlerFunc {
return func(c *gin.Context) {
user := authenticate(c)
- // Add user info to scope for all downstream handlers
- scope := tracewaygin.GetScopeFromGin(c)
- scope.SetTag("user_id", user.ID)
- scope.SetTag("user_email", user.Email)
- scope.SetTag("organization", user.OrgID)
- scope.SetTag("role", user.Role)
+ // Add user info to attributes for all downstream handlers
+ attributes := tracewaygin.GetAttributesFromGin(c)
+ attributes.SetTag("user_id", user.ID)
+ attributes.SetTag("user_email", user.Email)
+ attributes.SetTag("organization", user.OrgID)
+ attributes.SetTag("role", user.Role)
c.Next()
}
}
```
-## Global Scope
+## Global Attributes
-Global scope tags apply to all telemetry data. Configure them once at application startup:
+Global attribute tags apply to all telemetry data. Configure them once at application startup:
```go
import "github.com/tracewayapp/go-client/traceway"
func main() {
- // Configure global scope (runs once at startup)
- traceway.ConfigureScope(func(s *traceway.Scope) {
+ // Configure global attributes (runs once at startup)
+ traceway.ConfigureAttributes(func(s *traceway.Attributes) {
s.SetTag("environment", "production")
s.SetTag("region", "us-east-1")
s.SetTag("service", "user-api")
@@ -94,15 +93,15 @@ func main() {
}
```
-Global tags are inherited by every request scope and background task.
+Global tags are inherited by every request's attributes and background task.
## Tag Inheritance
-Tags flow from global to request scope:
+Tags flow from global to request attributes:
```
-Global Scope Request Scope Final Tags
-───────────── ───────────── ──────────
+Global Attributes Request Attributes Final Tags
+───────────────── ────────────────── ──────────
environment: prod + user_id: 123 = environment: prod
region: us-east-1 tenant: acme region: us-east-1
service: user-api service: user-api
@@ -117,7 +116,7 @@ Request-level tags override global tags if they have the same key.
### 1. Set Global Context at Startup
```go
-traceway.ConfigureScope(func(s *traceway.Scope) {
+traceway.ConfigureAttributes(func(s *traceway.Attributes) {
s.SetTag("environment", os.Getenv("ENV"))
s.SetTag("version", version)
s.SetTag("region", os.Getenv("AWS_REGION"))
@@ -131,9 +130,9 @@ traceway.ConfigureScope(func(s *traceway.Scope) {
func authMiddleware() gin.HandlerFunc {
return func(c *gin.Context) {
if user := getCurrentUser(c); user != nil {
- scope := tracewaygin.GetScopeFromGin(c)
- scope.SetTag("user_id", user.ID)
- scope.SetTag("organization", user.OrgID)
+ attributes := tracewaygin.GetAttributesFromGin(c)
+ attributes.SetTag("user_id", user.ID)
+ attributes.SetTag("organization", user.OrgID)
}
c.Next()
}
@@ -144,9 +143,9 @@ func authMiddleware() gin.HandlerFunc {
```go
func createOrderHandler(c *gin.Context) {
- scope := tracewaygin.GetScopeFromGin(c)
- scope.SetTag("action", "create_order")
- scope.SetTag("item_count", fmt.Sprintf("%d", len(items)))
+ attributes := tracewaygin.GetAttributesFromGin(c)
+ attributes.SetTag("action", "create_order")
+ attributes.SetTag("item_count", fmt.Sprintf("%d", len(items)))
// ... rest of handler
}
```
@@ -155,13 +154,13 @@ func createOrderHandler(c *gin.Context) {
```go
// Good - descriptive and searchable
-scope.SetTag("user_id", userID)
-scope.SetTag("order_id", orderID)
-scope.SetTag("payment_method", "stripe")
+attributes.SetTag("user_id", userID)
+attributes.SetTag("order_id", orderID)
+attributes.SetTag("payment_method", "stripe")
// Avoid - too generic
-scope.SetTag("id", someID)
-scope.SetTag("type", "thing")
+attributes.SetTag("id", someID)
+attributes.SetTag("type", "thing")
```
## Viewing Tags in Dashboard
diff --git a/docs/pages/go-client/gin/configuration.mdx b/docs/pages/go-client/gin/configuration.mdx
index c0817068..8bc0afb7 100644
--- a/docs/pages/go-client/gin/configuration.mdx
+++ b/docs/pages/go-client/gin/configuration.mdx
@@ -51,8 +51,7 @@ import (
)
func main() {
- // Configure global scope (optional)
- traceway.ConfigureScope(func(s *traceway.Scope) {
+ traceway.ConfigureAttributes(func(s *traceway.Attributes) {
s.SetTag("environment", "production")
s.SetTag("service", "user-api")
})
@@ -99,9 +98,8 @@ func main() {
// Routes
router.GET("/api/users/:id", func(c *gin.Context) {
- // Add request-specific context
- scope := tracewaygin.GetScopeFromGin(c)
- scope.SetTag("user_id", c.Param("id"))
+ attributes := tracewaygin.GetAttributesFromGin(c)
+ attributes.SetTag("user_id", c.Param("id"))
// Track database query
ctx := c.Request.Context()
diff --git a/docs/pages/go-client/gin/quickstart.mdx b/docs/pages/go-client/gin/quickstart.mdx
index 871676a4..04be43c3 100644
--- a/docs/pages/go-client/gin/quickstart.mdx
+++ b/docs/pages/go-client/gin/quickstart.mdx
@@ -98,6 +98,6 @@ func handler(c *gin.Context) {
## Next Steps
- [Configuration](/go-client/gin/configuration) - All configuration options and error recording flags
-- [Scope](/go-client/scope) - Add contextual tags to requests
+- [Attributes](/go-client/attributes) - Add contextual tags to requests
- [Exceptions](/go-client/exceptions) - Manual exception capture
- [Segments](/go-client/segments) - Track sub-operations within requests
diff --git a/frontend/src/lib/components/scope-display.svelte b/frontend/src/lib/components/attributes-display.svelte
similarity index 90%
rename from frontend/src/lib/components/scope-display.svelte
rename to frontend/src/lib/components/attributes-display.svelte
index e8f9b11c..44c09384 100644
--- a/frontend/src/lib/components/scope-display.svelte
+++ b/frontend/src/lib/components/attributes-display.svelte
@@ -2,14 +2,14 @@
import * as Popover from "$lib/components/ui/popover";
interface Props {
- scope: Record<string, string> | null | undefined;
+ attributes: Record<string, string> | null | undefined;
maxInlineTags?: number;
}
- let { scope, maxInlineTags = 3 }: Props = $props();
+ let { attributes, maxInlineTags = 3 }: Props = $props();
const entries = $derived(
- Object.entries(scope || {}).sort((a, b) => a[0].localeCompare(b[0]))
+ Object.entries(attributes || {}).sort((a, b) => a[0].localeCompare(b[0]))
);
const hasMore = $derived(entries.length > maxInlineTags);
const visibleEntries = $derived(entries.slice(0, maxInlineTags));
diff --git a/frontend/src/lib/components/issues/event-card.svelte b/frontend/src/lib/components/issues/event-card.svelte
index db57c7b0..c5df812b 100644
--- a/frontend/src/lib/components/issues/event-card.svelte
+++ b/frontend/src/lib/components/issues/event-card.svelte
@@ -55,11 +55,11 @@
</div>
<!-- Context -->
- {#if occurrence.scope && Object.keys(occurrence.scope).length > 0}
+ {#if occurrence.attributes && Object.keys(occurrence.attributes).length > 0}
<hr class="border-border" />
<div>
- <p class="text-sm font-medium mb-3">Context (Scope)</p>
- <ContextGrid scope={occurrence.scope} />
+ <p class="text-sm font-medium mb-3">Context</p>
+ <ContextGrid attributes={occurrence.attributes} />
</div>
{/if}
diff --git a/frontend/src/lib/components/ui/context-grid/context-grid.svelte b/frontend/src/lib/components/ui/context-grid/context-grid.svelte
index 3903c10b..7cc9dc4d 100644
--- a/frontend/src/lib/components/ui/context-grid/context-grid.svelte
+++ b/frontend/src/lib/components/ui/context-grid/context-grid.svelte
@@ -2,15 +2,15 @@
import ContextView from './context-view.svelte';
let {
- scope,
+ attributes,
sorted = true
}: {
- scope: Record<string, string>;
+ attributes: Record<string, string>;
sorted?: boolean;
} = $props();
const entries = $derived(() => {
- const items = Object.entries(scope);
+ const items = Object.entries(attributes);
if (sorted) {
return items.sort((a, b) => a[0].localeCompare(b[0]));
}
diff --git a/frontend/src/lib/types/exceptions.ts b/frontend/src/lib/types/exceptions.ts
index 37394acc..cd7be122 100644
--- a/frontend/src/lib/types/exceptions.ts
+++ b/frontend/src/lib/types/exceptions.ts
@@ -13,7 +13,7 @@ export type ExceptionOccurrence = {
exceptionHash: string;
stackTrace: string;
recordedAt: string;
- scope: Record<string, string> | null;
+ attributes: Record<string, string> | null;
appVersion: string;
serverName: string;
isMessage: boolean;
diff --git a/frontend/src/lib/types/spans.ts b/frontend/src/lib/types/spans.ts
index fdd7e348..54b6d8cb 100644
--- a/frontend/src/lib/types/spans.ts
+++ b/frontend/src/lib/types/spans.ts
@@ -17,7 +17,7 @@ export type TraceDetail = {
statusCode: number;
bodySize: number;
clientIP: string;
- scope: Record<string, string> | null;
+ attributes: Record<string, string> | null;
appVersion: string;
serverName: string;
};
@@ -33,7 +33,7 @@ export type MessageInfo = {
exceptionHash: string;
stackTrace: string;
recordedAt: string;
- scope?: Record<string, string>;
+ attributes?: Record<string, string>;
};
export type TraceDetailResponse = {
diff --git a/frontend/src/routes/endpoints/[endpoint]/+page.svelte b/frontend/src/routes/endpoints/[endpoint]/+page.svelte
index b4c08dab..0f2cb392 100644
--- a/frontend/src/routes/endpoints/[endpoint]/+page.svelte
+++ b/frontend/src/routes/endpoints/[endpoint]/+page.svelte
@@ -13,7 +13,7 @@
import { CalendarDate } from "@internationalized/date";
import { ErrorDisplay } from "$lib/components/ui/error-display";
import { projectsState } from '$lib/state/projects.svelte';
- import ScopeDisplay from '$lib/components/scope-display.svelte';
+ import AttributesDisplay from '$lib/components/attributes-display.svelte';
import { createRowClickHandler } from '$lib/utils/navigation';
import { createSmartBackHandler } from '$lib/utils/back-navigation';
import PaginationFooter from '$lib/components/ui/pagination-footer/pagination-footer.svelte';
@@ -43,7 +43,7 @@
statusCode: number;
bodySize: number;
clientIP: string;
- scope: Record<string, string> | null;
+ attributes: Record<string, string> | null;
serverName: string;
appVersion: string;
};
@@ -386,7 +386,7 @@
{transaction.appVersion || '-'}
</Table.Cell>
<Table.Cell>
- <ScopeDisplay scope={transaction.scope} />
+ <AttributesDisplay attributes={transaction.attributes} />
</Table.Cell>
</Table.Row>
{/each}
diff --git a/frontend/src/routes/endpoints/[endpoint]/[endpointId]/+page.svelte b/frontend/src/routes/endpoints/[endpoint]/[endpointId]/+page.svelte
index 6fc38b79..6e3746bd 100644
--- a/frontend/src/routes/endpoints/[endpoint]/[endpointId]/+page.svelte
+++ b/frontend/src/routes/endpoints/[endpoint]/[endpointId]/+page.svelte
@@ -152,11 +152,11 @@
/>
</div>
- {#if response.endpoint.scope && Object.keys(response.endpoint.scope).length > 0}
+ {#if response.endpoint.attributes && Object.keys(response.endpoint.attributes).length > 0}
<hr class="border-border" />
<div>
- <p class="mb-3 text-sm font-medium">Context (Scope)</p>
- <ContextGrid scope={response.endpoint.scope} />
+ <p class="mb-3 text-sm font-medium">Context</p>
+ <ContextGrid attributes={response.endpoint.attributes} />
</div>
{/if}
</Card.Content>
@@ -211,7 +211,7 @@
<Table.Row>
<Table.Head class="pl-6">Message</Table.Head>
<Table.Head class="w-[180px]">Recorded At</Table.Head>
- <Table.Head class="w-[100px] pr-6">Scope</Table.Head>
+ <Table.Head class="w-[100px] pr-6">Attributes</Table.Head>
</Table.Row>
</Table.Header>
<Table.Body>
@@ -229,9 +229,9 @@
{formatDateTime(message.recordedAt, { timezone })}
</Table.Cell>
<Table.Cell class="pr-6">
- {#if message.scope && Object.keys(message.scope).length > 0}
+ {#if message.attributes && Object.keys(message.attributes).length > 0}
<span class="text-xs text-muted-foreground">
- {Object.keys(message.scope).length} key{Object.keys(message.scope).length === 1 ? '' : 's'}
+ {Object.keys(message.attributes).length} key{Object.keys(message.attributes).length === 1 ? '' : 's'}
</span>
{:else}
<span class="text-xs text-muted-foreground">-</span>
diff --git a/frontend/src/routes/tasks/[task]/+page.svelte b/frontend/src/routes/tasks/[task]/+page.svelte
index 3dfc218b..838c227c 100644
--- a/frontend/src/routes/tasks/[task]/+page.svelte
+++ b/frontend/src/routes/tasks/[task]/+page.svelte
@@ -11,7 +11,7 @@
import { CalendarDate } from "@internationalized/date";
import { ErrorDisplay } from "$lib/components/ui/error-display";
import { projectsState } from '$lib/state/projects.svelte';
- import ScopeDisplay from '$lib/components/scope-display.svelte';
+ import AttributesDisplay from '$lib/components/attributes-display.svelte';
import { createRowClickHandler } from '$lib/utils/navigation';
import { createSmartBackHandler } from '$lib/utils/back-navigation';
import PaginationFooter from '$lib/components/ui/pagination-footer/pagination-footer.svelte';
@@ -39,7 +39,7 @@
duration: number;
recordedAt: string;
clientIP: string;
- scope: Record<string, string> | null;
+ attributes: Record<string, string> | null;
serverName: string;
appVersion: string;
};
@@ -340,7 +340,7 @@
{task.appVersion || '-'}
</Table.Cell>
<Table.Cell>
- <ScopeDisplay scope={task.scope} />
+ <AttributesDisplay attributes={task.attributes} />
</Table.Cell>
</Table.Row>
{/each}
diff --git a/frontend/src/routes/tasks/[task]/[taskId]/+page.svelte b/frontend/src/routes/tasks/[task]/[taskId]/+page.svelte
index 3ba6787b..82d1d143 100644
--- a/frontend/src/routes/tasks/[task]/[taskId]/+page.svelte
+++ b/frontend/src/routes/tasks/[task]/[taskId]/+page.svelte
@@ -26,7 +26,7 @@
duration: number;
recordedAt: string;
clientIP: string;
- scope: Record<string, string> | null;
+ attributes: Record<string, string> | null;
serverName: string;
appVersion: string;
};
@@ -39,7 +39,7 @@
exceptionHash: string;
stackTrace: string;
recordedAt: string;
- scope?: Record<string, string>;
+ attributes?: Record<string, string>;
}[];
spans: any[];
hasSpans: boolean;
@@ -150,11 +150,11 @@
/>
</div>
- {#if response.task.scope && Object.keys(response.task.scope).length > 0}
+ {#if response.task.attributes && Object.keys(response.task.attributes).length > 0}
<hr class="border-border" />
<div>
- <p class="mb-3 text-sm font-medium">Context (Scope)</p>
- <ContextGrid scope={response.task.scope} />
+ <p class="mb-3 text-sm font-medium">Context</p>
+ <ContextGrid attributes={response.task.attributes} />
</div>
{/if}
</Card.Content>
@@ -209,7 +209,7 @@
<Table.Row>
<Table.Head class="pl-6">Message</Table.Head>
<Table.Head class="w-[180px]">Recorded At</Table.Head>
- <Table.Head class="w-[100px] pr-6">Scope</Table.Head>
+ <Table.Head class="w-[100px] pr-6">Attributes</Table.Head>
</Table.Row>
</Table.Header>
<Table.Body>
@@ -227,9 +227,9 @@
{formatDateTime(message.recordedAt, { timezone })}
</Table.Cell>
<Table.Cell class="pr-6">
- {#if message.scope && Object.keys(message.scope).length > 0}
+ {#if message.attributes && Object.keys(message.attributes).length > 0}
<span class="text-xs text-muted-foreground">
- {Object.keys(message.scope).length} key{Object.keys(message.scope).length === 1 ? '' : 's'}
+ {Object.keys(message.attributes).length} key{Object.keys(message.attributes).length === 1 ? '' : 's'}
</span>
{:else}
<span class="text-xs text-muted-foreground">-</span>