isTransaction detects Sentry transaction payloads that should be stored in structured tables but NOT appear in the global event feed. Transactions have spans and start_timestamp but typically no exception data.
(parsed map[string]any)
| 359 | // in structured tables but NOT appear in the global event feed. |
| 360 | // Transactions have spans and start_timestamp but typically no exception data. |
| 361 | func isTransaction(parsed map[string]any) bool { |
| 362 | _, hasSpans := parsed["spans"] |
| 363 | _, hasStartTS := parsed["start_timestamp"] |
| 364 | if !hasSpans || !hasStartTS { |
| 365 | return false |
| 366 | } |
| 367 | |
| 368 | // If it has exception data, it's an error event with trace context — keep it. |
| 369 | if exc, ok := parsed["exception"].(map[string]any); ok { |
| 370 | if vals, ok := exc["values"].([]any); ok && len(vals) > 0 { |
| 371 | return false |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | return true |
| 376 | } |
| 377 | |
| 378 | func extractProject(path string) string { |
| 379 | parts := strings.Split(strings.Trim(path, "/"), "/") |