Skip to content

Commit

Permalink
remove sentry
Browse files Browse the repository at this point in the history
the overhead of sentry is too high for the inlang sdk. errors that occur are eventually reported by apps.
  • Loading branch information
samuelstroschein committed Feb 9, 2025
1 parent 76ad08a commit fc41e71
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 140 deletions.
7 changes: 7 additions & 0 deletions .changeset/wicked-ducks-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@inlang/sdk": minor
---

remove sentry

the overhead of sentry is too high for the inlang sdk. errors that occur are eventually reported by apps.
3 changes: 0 additions & 3 deletions inlang/packages/sdk/.sentryclirc

This file was deleted.

6 changes: 1 addition & 5 deletions inlang/packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,20 @@
"_comment": "Required for tree-shaking https://webpack.js.org/guides/tree-shaking/#mark-the-file-as-side-effect-free",
"sideEffects": false,
"scripts": {
"prepublish": "npm run sentry:sourcemaps",
"build": "npm run env-variables && tsc --build",
"dev": "npm run env-variables && tsc --watch",
"env-variables": "node ./src/services/env-variables/createIndexFile.js",
"test": "tsc --noEmit && vitest run",
"test:watch": "vitest",
"lint": "eslint ./src",
"format": "prettier ./src --write",
"clean": "rm -rf ./dist ./node_modules",
"sentry:sourcemaps": "sentry-cli sourcemaps inject --org opral --project inlang-sdk ./dist && sentry-cli sourcemaps upload --org opral --project inlang-sdk ./dist"
"clean": "rm -rf ./dist ./node_modules"
},
"engines": {
"node": ">=18.0.0"
},
"dependencies": {
"@lix-js/sdk": "workspace:*",
"@sentry/browser": "^7.118.0",
"@sinclair/typebox": "^0.31.17",
"kysely": "^0.27.4",
"sqlite-wasm-kysely": "workspace:*",
Expand All @@ -48,7 +45,6 @@
"devDependencies": {
"@opral/tsconfig": "workspace:*",
"@eslint/js": "^9.12.0",
"@sentry/cli": "^2.35.0",
"@types/node": "^22.5.1",
"@types/uuid": "^10.0.0",
"@vitest/coverage-v8": "^2.0.5",
Expand Down
3 changes: 0 additions & 3 deletions inlang/packages/sdk/src/project/loadProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
import type { InlangProject } from "./api.js";
import { withLanguageTagToLocaleMigration } from "../migrations/v2/withLanguageTagToLocaleMigration.js";
import { v4 } from "uuid";
import { initErrorReporting } from "../services/error-reporting/index.js";
import { maybeCaptureLoadedProject } from "./maybeCaptureTelemetry.js";
import { importFiles } from "../import-export/importFiles.js";
import { exportFiles } from "../import-export/exportFiles.js";
Expand Down Expand Up @@ -110,8 +109,6 @@ export async function loadProject(args: {
appId: args.appId,
});

initErrorReporting({ projectId: id });

return {
db,
id: {
Expand Down
2 changes: 0 additions & 2 deletions inlang/packages/sdk/src/project/maybeCaptureTelemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { capture } from "../services/telemetry/capture.js";
import type { InlangDatabaseSchema } from "../database/schema.js";
import { ENV_VARIABLES } from "../services/env-variables/index.js";
import type { ProjectSettings } from "../json-schema/settings.js";
import { captureError } from "../services/error-reporting/index.js";
import type { Lix } from "@lix-js/sdk";

export async function maybeCaptureLoadedProject(args: {
Expand Down Expand Up @@ -64,6 +63,5 @@ export async function maybeCaptureLoadedProject(args: {
// The project has been closed, nothing to capture
return;
}
captureError(e);
}
}
2 changes: 0 additions & 2 deletions inlang/packages/sdk/src/project/newProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
createInMemoryDatabase,
} from "sqlite-wasm-kysely";
import { initDb } from "../database/initDb.js";
import { captureError } from "../services/error-reporting/index.js";

/**
* Creates a new inlang project.
Expand Down Expand Up @@ -58,7 +57,6 @@ export async function newProject(args?: {
const error = new Error(`Failed to create new inlang project: ${e}`, {
cause: e,
});
captureError(error);
throw error;
} finally {
sqlite.close();
Expand Down
28 changes: 0 additions & 28 deletions inlang/packages/sdk/src/services/error-reporting/index.ts

This file was deleted.

9 changes: 4 additions & 5 deletions inlang/packages/sdk/src/services/telemetry/capture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import type { ProjectSettings } from "../../json-schema/settings.js";
import { ENV_VARIABLES } from "../env-variables/index.js";
import { captureError } from "../error-reporting/index.js";

/**
* List of telemetry events for typesafety.
Expand Down Expand Up @@ -54,8 +53,8 @@ export const capture = async (
// we need at least one property to make a project visible in the dashboar
properties: { name: args.projectId },
});
} catch (e) {
captureError(e);
} catch {
// do nothing
}
};

Expand Down Expand Up @@ -93,7 +92,7 @@ const identifyProject = async (args: {
},
}),
});
} catch (e) {
captureError(e);
} catch {
// do nothing
}
};
92 changes: 0 additions & 92 deletions pnpm-lock.yaml

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

0 comments on commit fc41e71

Please sign in to comment.