Skip to content

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

exceptions only on the dashboard + nicer json for context

dduxba73f0232268
diff --git a/backend/app/controllers/dashboard.controller.go b/backend/app/controllers/dashboard.controller.go
index 86c5e149..229a20b2 100644
--- a/backend/app/controllers/dashboard.controller.go
+++ b/backend/app/controllers/dashboard.controller.go
@@ -29,8 +29,8 @@ func (d dashboardController) GetDashboardOverview(c *gin.Context) {
now := time.Now()
start := now.Add(-24 * time.Hour)
- // Get last 10 issues in the last 24 hours
- recentIssues, _, err := repositories.ExceptionStackTraceRepository.FindGrouped(c, projectId, start, now, 1, 10, "last_seen", "", "", false)
+ // Get last 10 issues in the last 24 hours (only exceptions, not messages)
+ recentIssues, _, err := repositories.ExceptionStackTraceRepository.FindGrouped(c, projectId, start, now, 1, 10, "last_seen", "", "issues", false)
if err != nil {
panic(err)
}
diff --git a/frontend/package-lock.json b/frontend/package-lock.json
index f69977de..e6c29015 100644
--- a/frontend/package-lock.json
+++ b/frontend/package-lock.json
@@ -11,6 +11,7 @@
"lucide-svelte": "^0.562.0",
"luxon": "^3.7.2",
"svelte-highlight": "^7.9.0",
+ "svelte-json-tree": "^2.2.0",
"svelte-sonner": "^1.0.7"
},
"devDependencies": {
@@ -787,6 +788,7 @@
"version": "0.3.13",
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
"integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.5.0",
@@ -797,6 +799,7 @@
"version": "2.3.5",
"resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz",
"integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@jridgewell/gen-mapping": "^0.3.5",
@@ -807,6 +810,7 @@
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
"integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
+ "dev": true,
"license": "MIT",
"engines": {
"node": ">=6.0.0"
@@ -816,12 +820,14 @@
"version": "1.5.5",
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
"integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",
+ "dev": true,
"license": "MIT"
},
"node_modules/@jridgewell/trace-mapping": {
"version": "0.3.31",
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",
"integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@jridgewell/resolve-uri": "^3.1.0",
@@ -1213,6 +1219,7 @@
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.8.tgz",
"integrity": "sha512-esgN+54+q0NjB0Y/4BomT9samII7jGwNy/2a3wNZbT2A2RpmXsXwUt24LvLhx6jUq2gVk4cWEvcRO6MFQbOfNA==",
+ "dev": true,
"license": "MIT",
"peerDependencies": {
"acorn": "^8.9.0"
@@ -1710,6 +1717,7 @@
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz",
"integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==",
+ "dev": true,
"license": "MIT"
},
"node_modules/@types/json-schema": {
@@ -1996,6 +2004,7 @@
"version": "8.15.0",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz",
"integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==",
+ "dev": true,
"license": "MIT",
"bin": {
"acorn": "bin/acorn"
@@ -2058,6 +2067,7 @@
"version": "5.3.2",
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz",
"integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==",
+ "dev": true,
"license": "Apache-2.0",
"engines": {
"node": ">= 0.4"
@@ -2067,6 +2077,7 @@
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz",
"integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==",
+ "dev": true,
"license": "Apache-2.0",
"engines": {
"node": ">= 0.4"
@@ -2162,6 +2173,7 @@
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz",
"integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==",
+ "dev": true,
"license": "MIT",
"engines": {
"node": ">=6"
@@ -2666,6 +2678,7 @@
"version": "5.6.1",
"resolved": "https://registry.npmjs.org/devalue/-/devalue-5.6.1.tgz",
"integrity": "sha512-jDwizj+IlEZBunHcOuuFVBnIMPAEHvTsJj0BcIp94xYguLRVBcXO853px/MyIJvbVzWdsGvrRweIUWJw8hBP7A==",
+ "dev": true,
"license": "MIT"
},
"node_modules/enhanced-resolve": {
@@ -2918,6 +2931,7 @@
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/esrap/-/esrap-2.2.1.tgz",
"integrity": "sha512-GiYWG34AN/4CUyaWAgunGt0Rxvr1PTMlGC0vvEov/uOQYWne2bpN03Um+k8jT+q3op33mKouP2zeJ6OlM+qeUg==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.4.15"
@@ -3207,6 +3221,7 @@
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.3.tgz",
"integrity": "sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@types/estree": "^1.0.6"
@@ -3635,6 +3650,7 @@
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz",
"integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==",
+ "dev": true,
"license": "MIT"
},
"node_modules/locate-path": {
@@ -3699,6 +3715,7 @@
"version": "0.30.21",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz",
"integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.5.5"
@@ -4398,6 +4415,7 @@
"version": "5.46.1",
"resolved": "https://registry.npmjs.org/svelte/-/svelte-5.46.1.tgz",
"integrity": "sha512-ynjfCHD3nP2el70kN5Pmg37sSi0EjOm9FgHYQdC4giWG/hzO3AatzXXJJgP305uIhGQxSufJLuYWtkY8uK/8RA==",
+ "dev": true,
"license": "MIT",
"dependencies": {
"@jridgewell/remapping": "^2.3.4",
@@ -4483,6 +4501,15 @@
"highlight.js": "11.11.1"
}
},
+ "node_modules/svelte-json-tree": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/svelte-json-tree/-/svelte-json-tree-2.2.0.tgz",
+ "integrity": "sha512-zcfepTrJ6xhpdgRZEujmiFh+ainRw7HO4Bsoh8PMAsm7fkgUPtnrZi3An8tmCFY8jajYhMrauHsd1S1XTeuiCw==",
+ "license": "MIT",
+ "peerDependencies": {
+ "svelte": "^4.0.0"
+ }
+ },
"node_modules/svelte-sonner": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/svelte-sonner/-/svelte-sonner-1.0.7.tgz",
@@ -4861,6 +4888,7 @@
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.4.tgz",
"integrity": "sha512-B58NGBEoc8Y9MWWCQGl/gq9xBCe4IiKM0a2x7GZdQKOW5Exr8S1W24J6OgM1njK8xCRGvAJIL/MxXHf6SkmQKQ==",
+ "dev": true,
"license": "MIT"
}
}
diff --git a/frontend/package.json b/frontend/package.json
index 73944f3e..0ad606b0 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -56,6 +56,7 @@
"lucide-svelte": "^0.562.0",
"luxon": "^3.7.2",
"svelte-highlight": "^7.9.0",
+ "svelte-json-tree": "^2.2.0",
"svelte-sonner": "^1.0.7"
}
}
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 44c47589..3903c10b 100644
--- a/frontend/src/lib/components/ui/context-grid/context-grid.svelte
+++ b/frontend/src/lib/components/ui/context-grid/context-grid.svelte
@@ -1,4 +1,6 @@
<script lang="ts">
+ import ContextView from './context-view.svelte';
+
let {
scope,
sorted = true
@@ -18,9 +20,6 @@
<div class="grid grid-cols-1 gap-3 sm:grid-cols-2 md:grid-cols-3">
{#each entries() as [key, value]}
- <div class="flex flex-col gap-1 rounded-md bg-muted p-3">
- <span class="text-xs font-medium text-muted-foreground">{key}</span>
- <span class="font-mono text-sm break-all">{value}</span>
- </div>
+ <ContextView title={key} {value} />
{/each}
</div>
diff --git a/frontend/src/lib/components/ui/context-grid/context-view.svelte b/frontend/src/lib/components/ui/context-grid/context-view.svelte
new file mode 100644
index 00000000..e362d52d
--- /dev/null
+++ b/frontend/src/lib/components/ui/context-grid/context-view.svelte
@@ -0,0 +1,101 @@
+<script lang="ts">
+ import JSONTree from 'svelte-json-tree';
+ import { Copy, Check } from 'lucide-svelte';
+
+ let {
+ title,
+ value
+ }: {
+ title: string;
+ value: string;
+ } = $props();
+
+ let copied = $state(false);
+
+ const parsedJson = $derived(() => {
+ try {
+ const parsed = JSON.parse(value);
+ if (typeof parsed === 'object' && parsed !== null) {
+ return parsed;
+ }
+ } catch {
+ // Not valid JSON
+ }
+ return null;
+ });
+
+ async function copyToClipboard() {
+ await navigator.clipboard.writeText(value);
+ copied = true;
+ setTimeout(() => {
+ copied = false;
+ }, 2000);
+ }
+</script>
+
+<div class="group relative flex flex-col gap-1 rounded-md bg-muted p-3">
+ <div class="flex items-center justify-between">
+ <span class="text-xs font-medium text-muted-foreground">{title}</span>
+ <button
+ onclick={copyToClipboard}
+ class="opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-foreground"
+ title="Copy to clipboard"
+ >
+ {#if copied}
+ <Check class="h-3.5 w-3.5 text-green-500" />
+ {:else}
+ <Copy class="h-3.5 w-3.5" />
+ {/if}
+ </button>
+ </div>
+ {#if parsedJson()}
+ <div class="json-tree-container">
+ <JSONTree value={parsedJson()} />
+ </div>
+ {:else}
+ <span class="font-mono text-sm break-all">{value}</span>
+ {/if}
+</div>
+
+<style>
+ .json-tree-container {
+ --json-tree-font-size: 0.875rem;
+ --json-tree-font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
+ --json-tree-li-indentation: 1.25em;
+ --json-tree-li-line-height: 1.5;
+
+ /* Light mode colors */
+ --json-tree-string-color: oklch(0.6 0.15 25);
+ --json-tree-symbol-color: oklch(0.6 0.15 25);
+ --json-tree-boolean-color: oklch(0.5 0.15 260);
+ --json-tree-function-color: oklch(0.5 0.15 260);
+ --json-tree-number-color: oklch(0.5 0.18 280);
+ --json-tree-label-color: oklch(0.5 0.15 320);
+ --json-tree-property-color: oklch(0.35 0.05 265);
+ --json-tree-arrow-color: oklch(0.55 0.03 265);
+ --json-tree-operator-color: oklch(0.55 0.03 265);
+ --json-tree-null-color: oklch(0.55 0.03 265);
+ --json-tree-undefined-color: oklch(0.55 0.03 265);
+ --json-tree-date-color: oklch(0.55 0.03 265);
+ --json-tree-internal-color: oklch(0.55 0.03 265);
+ --json-tree-regex-color: oklch(0.6 0.15 25);
+ }
+
+ :global(.dark) .json-tree-container {
+ /* Dark mode colors */
+ --json-tree-string-color: oklch(0.75 0.15 25);
+ --json-tree-symbol-color: oklch(0.75 0.15 25);
+ --json-tree-boolean-color: oklch(0.7 0.15 260);
+ --json-tree-function-color: oklch(0.7 0.15 260);
+ --json-tree-number-color: oklch(0.7 0.18 280);
+ --json-tree-label-color: oklch(0.7 0.15 320);
+ --json-tree-property-color: oklch(0.9 0.02 265);
+ --json-tree-arrow-color: oklch(0.65 0 0);
+ --json-tree-operator-color: oklch(0.65 0 0);
+ --json-tree-null-color: oklch(0.65 0 0);
+ --json-tree-undefined-color: oklch(0.65 0 0);
+ --json-tree-date-color: oklch(0.65 0 0);
+ --json-tree-internal-color: oklch(0.65 0 0);
+ --json-tree-regex-color: oklch(0.75 0.15 25);
+ }
+</style>
diff --git a/frontend/src/lib/components/ui/context-grid/index.ts b/frontend/src/lib/components/ui/context-grid/index.ts
index d646d67f..5802c998 100644
--- a/frontend/src/lib/components/ui/context-grid/index.ts
+++ b/frontend/src/lib/components/ui/context-grid/index.ts
@@ -1 +1,2 @@
export { default as ContextGrid } from './context-grid.svelte';
+export { default as ContextView } from './context-view.svelte';
diff --git a/testing/devtesting/devtesting.go b/testing/devtesting/devtesting.go
index 525ec01d..bb58d2cd 100644
--- a/testing/devtesting/devtesting.go
+++ b/testing/devtesting/devtesting.go
@@ -47,6 +47,12 @@ func testGin() {
})
}()
})
+ router.GET("/test-json", func(ctx *gin.Context) {
+ scope := traceway.GetScopeFromContext(ctx)
+ scope.SetTag("json tag", veryLongJsonForTestin)
+ traceway.CaptureMessageWithContext(ctx, "test json")
+ })
+
router.GET("/test-message", func(ctx *gin.Context) {
for i := range 10 {
traceway.CaptureMessageWithContext(ctx, "test message "+strconv.Itoa(i))
@@ -127,3 +133,5 @@ func testGin() {
router.Run()
}
+
+var veryLongJsonForTestin = `{"str": "traceway", "obj": {"id": 1}, "obj2": {"id": 1}, "obj3": {"id": 1}, "obj4": {"id": 1}, "obj5loremipsumdoloret": {"id": "I'm baby tumeric VHS Brooklyn, echo park literally you probably haven't heard of them crucifix taiyaki chambray roof party man bun knausgaard waistcoat squid health goth. Gastropub godard bodega boys snackwave asymmetrical la croix. Whatever try-hard pour-over humblebrag austin microdosing organic bruh. Keffiyeh mukbang yuccie, 90's humblebrag roof party godard kale chips lo-fi sriracha aesthetic.", "id2": "ImbabytumericVHSBrooklynechoparkliterallyyouprobablyhaventheardofthemcrucifixtaiyakichambrayroofpartymanbunknausgaardwaistcoatsquidhealthgothGastropubgodardbodegaboyssnackwaveasymmetricallacroixWhatevertryhardpouroverhumblebragaustinmicrodosingorganicbruhKeffiyehmukbangyuccieshumblebragroofpartygodardkalechipslofisrirachaaesthetic"}, "arr": [1, 2, "", {"key": 1, "key2": "example"}]}`