Skip to content

Commit

Permalink
feat: Add Spotlight to Node events (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcramer authored Nov 28, 2023
1 parent a0fd62b commit f50f50b
Show file tree
Hide file tree
Showing 9 changed files with 627 additions and 405 deletions.
6 changes: 3 additions & 3 deletions apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"@paralleldrive/cuid2": "^2.2.2",
"@peated/design": "workspace:*",
"@peated/tsconfig": "workspace:*",
"@sentry/core": "^7.80.1",
"@sentry/node-experimental": "^7.80.1",
"@sentry/core": "^7.83.0",
"@sentry/node-experimental": "^7.83.0",
"@sentry/profiling-node": "^1.2.6",
"@sentry/utils": "^7.80.0",
"@sentry/utils": "^7.83.0",
"@trpc/client": "^10.43.3",
"@trpc/server": "^10.43.3",
"@types/bcrypt": "^5.0.2",
Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/sentry.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import * as Sentry from "@sentry/node-experimental";
import { ProfilingIntegration } from "@sentry/profiling-node";
import config from "./config";

import packageData from "../package.json";
import config from "./config";

Sentry.init({
dsn: config.SENTRY_DSN,
release: config.VERSION,
tracesSampleRate: 1.0,
profilesSampleRate: 1.0,
integrations: [new ProfilingIntegration()],
spotlight: config.ENV === "development",
});

Sentry.setTag("service", packageData.name);
2 changes: 1 addition & 1 deletion apps/web/app/entry.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ startTransition(() => {
hydrateRoot(document, <RemixBrowser />);
});

import * as Spotlight from "@spotlightjs/core";
import * as Spotlight from "@spotlightjs/overlay";

if (config.ENV !== "production") {
Spotlight.init({
Expand Down
10 changes: 6 additions & 4 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@
"@remix-run/server-runtime": "^2.2.0",
"@rollup/plugin-replace": "^5.0.5",
"@sentry-internal/feedback": "0.0.1-alpha.9",
"@sentry/react": "^7.80.1",
"@sentry/remix": "^7.80.1",
"@sentry/vite-plugin": "^2.10.1",
"@spotlightjs/core": "^0.0.9",
"@sentry/react": "^7.83.0",
"@sentry/remix": "^7.83.0",
"@sentry/vite-plugin": "^2.10.2",
"@svgr/cli": "^8.1.0",
"@svgr/plugin-jsx": "^8.1.0",
"@svgr/plugin-svgo": "^8.1.0",
Expand Down Expand Up @@ -104,5 +103,8 @@
"extensions": "svg",
"quiet": false
}
},
"devDependencies": {
"@spotlightjs/overlay": "^0.0.17"
}
}
7 changes: 3 additions & 4 deletions apps/web/server.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import prom from "@isaacs/express-prometheus-middleware";
import { sentryLink } from "@peated/server/src/lib/trpc";
import { type AppRouter } from "@peated/server/trpc/router";
import { createRequestHandler } from "@remix-run/express";
import { type AppLoadContext } from "@remix-run/server-runtime";
import * as Sentry from "@sentry/remix";
import { wrapExpressCreateRequestHandler } from "@sentry/remix";
import { createTRPCProxyClient, httpBatchLink } from "@trpc/client";
import compression from "compression";
Expand All @@ -17,10 +19,6 @@ import {
getUser,
logout,
} from "~/services/session.server";

import * as Sentry from "@sentry/remix";

import { sentryLink } from "@peated/server/src/lib/trpc";
import packageData from "./package.json";

Sentry.init({
Expand All @@ -31,6 +29,7 @@ Sentry.init({
new Sentry.Integrations.Http({ tracing: true }),
...Sentry.autoDiscoverNodePerformanceMonitoringIntegrations(),
],
spotlight: config.ENV === "development",
// tracePropagationTargets: ["localhost", "peated.com", config.API_SERVER],
});

Expand Down
2 changes: 1 addition & 1 deletion apps/worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"dependencies": {
"@peated/server": "workspace:*",
"@peated/tsconfig": "workspace:*",
"@sentry/node-experimental": "^7.80.1",
"@sentry/node-experimental": "^7.83.0",
"@sentry/profiling-node": "^1.2.6",
"@swc/core": "^1.3.96",
"@trpc/client": "^10.43.3",
Expand Down
2 changes: 1 addition & 1 deletion apps/worker/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Sentry.init({
tracesSampleRate: 1.0,
profilesSampleRate: 1.0,
integrations: [new ProfilingIntegration()],
spotlight: process.env.NODE_ENV === "development",
});

Sentry.setTag("service", packageData.name);

const scheduler = new ToadScheduler();
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"author": "David Cramer",
"license": "Apache-2.0",
"dependencies": {
"@spotlightjs/sidecar": "^0.0.8",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"dotenv": "^16.3.1",
Expand Down Expand Up @@ -66,5 +65,8 @@
"{apps,packages}/**/*.{ts,tsx}": [
"eslint --cache --fix"
]
},
"devDependencies": {
"@spotlightjs/sidecar": "^0.0.8"
}
}
Loading

0 comments on commit f50f50b

Please sign in to comment.