Skip to content

Commit

Permalink
feat: add sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
9renpoto committed Aug 11, 2024
1 parent a9802d7 commit 179e892
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"$ga4": "https://raw.githubusercontent.com/denoland/ga4/main/mod.ts",
"./": "./",
"@/": "./",
"@sentry/deno": "npm:@sentry/deno",
"@deno/gfm": "jsr:@deno/gfm@^0.8.2",
"@preact/signals": "npm:@preact/signals@^1.3.0",
"@preact/signals-core": "npm:@preact/signals-core@^1.7.0",
Expand Down
29 changes: 29 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions fresh.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@ import tailwind from "$fresh/plugins/tailwind.ts";
import { freshSEOPlugin } from "$fresh_seo";
import manifest from "./fresh.gen.ts";
import { getPosts } from "./utils/posts.ts";
import * as Sentry from "@sentry/deno";

const dsn = Deno.env.get("SENTRY_DSN");

if (dsn) {
Sentry.init({
dsn,
sampleRate: 1.0,
tracesSampleRate: 1.0,
});
} else {
console.warn("SENTRY_DSN environment not set");
}

const posts = await getPosts();

Expand Down

1 comment on commit 179e892

@deno-deploy
Copy link
Contributor

@deno-deploy deno-deploy bot commented on 179e892 Aug 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed to deploy:

UNCAUGHT_EXCEPTION

TypeError: Deno.permissions.querySync is not a function
    at getHostName (file:///node_modules/.deno/@[email protected]/node_modules/@sentry/deno/index.mjs:11332:35)
    at new DenoClient (file:///node_modules/.deno/@[email protected]/node_modules/@sentry/deno/index.mjs:11364:41)
    at initAndBind (file:///node_modules/.deno/@[email protected]/node_modules/@sentry/deno/index.mjs:9322:18)
    at Module.init (file:///node_modules/.deno/@[email protected]/node_modules/@sentry/deno/index.mjs:12101:10)
    at file:///src/fresh.config.ts:11:10
    at eventLoopTick (ext:core/01_core.js:168:7)

Please sign in to comment.