Skip to content

Commit d531295

Browse files
committed
opentelemetryを排除
1 parent d01e487 commit d531295

File tree

4 files changed

+22
-20
lines changed

4 files changed

+22
-20
lines changed

instrumentation.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
import * as Sentry from "@sentry/nextjs";
1+
import { init, captureRequestError } from "@sentry/nextjs";
2+
23
export async function register() {
3-
if (process.env.NEXT_RUNTIME === "nodejs") {
4-
await import("./sentry.server.config");
5-
}
6-
if (process.env.NEXT_RUNTIME === "edge") {
7-
await import("./sentry.edge.config");
8-
}
4+
// ファイル分ける意味なくない?
5+
// if (process.env.NEXT_RUNTIME === "nodejs") {
6+
// await import("./sentry.server.config");
7+
// }
8+
// if (process.env.NEXT_RUNTIME === "edge") {
9+
// await import("./sentry.edge.config");
10+
// }
11+
init({
12+
dsn: "https://db719a3358e14ebc86cc975ea04b0dac@bugsink.utcode.net/1",
13+
// Adds request headers and IP for users
14+
sendDefaultPii: true,
15+
});
916
}
1017
// Capture errors from Server Components, middleware, and proxies
11-
export const onRequestError = Sentry.captureRequestError;
18+
export const onRequestError = captureRequestError;

next.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { initOpenNextCloudflareForDev } from "@opennextjs/cloudflare";
33
import { PyodidePlugin } from "@pyodide/webpack-plugin";
44
import { version as pyodideVersion } from "pyodide/package.json";
55
import { withSentryConfig } from "@sentry/nextjs";
6+
import webpack from "webpack";
67

78
initOpenNextCloudflareForDev();
89

@@ -52,6 +53,11 @@ const nextConfig: NextConfig = {
5253
outDirectory: `static/pyodide/v${pyodideVersion}`,
5354
})
5455
);
56+
config.plugins.push(
57+
new webpack.IgnorePlugin({
58+
resourceRegExp: /(?!:compiled\/)@?opentelemetry|kysely|prisma/,
59+
})
60+
);
5561
// import hoge from "./file?raw" でfileの中身を文字列としてインポート
5662
for (const rule of config.module.rules) {
5763
if (rule.resourceQuery instanceof RegExp) {
@@ -166,4 +172,5 @@ export default withSentryConfig(nextConfig, {
166172
excludeReplayShadowDom: true,
167173
excludeReplayWorker: true,
168174
},
175+
telemetry: false,
169176
});

sentry.edge.config.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

sentry.server.config.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)