@kapeta/local-cluster-service 0.25.0 → 0.25.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [0.25.2](https://github.com/kapetacom/local-cluster-service/compare/v0.25.1...v0.25.2) (2023-11-12)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Add sentry ([#97](https://github.com/kapetacom/local-cluster-service/issues/97)) ([e823e36](https://github.com/kapetacom/local-cluster-service/commit/e823e36f505965fbfa086c997ef70e91d7e3dbe1))
7
+
8
+ ## [0.25.1](https://github.com/kapetacom/local-cluster-service/compare/v0.25.0...v0.25.1) (2023-11-02)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * open up web-microfrontend version range ([b0f55d6](https://github.com/kapetacom/local-cluster-service/commit/b0f55d6c24183f7db6e79f6351e3e4d2cc70dbb0))
14
+
1
15
  # [0.25.0](https://github.com/kapetacom/local-cluster-service/compare/v0.24.3...v0.25.0) (2023-11-01)
2
16
 
3
17
 
package/dist/cjs/index.js CHANGED
@@ -3,6 +3,29 @@
3
3
  * Copyright 2023 Kapeta Inc.
4
4
  * SPDX-License-Identifier: BUSL-1.1
5
5
  */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
19
+ }) : function(o, v) {
20
+ o["default"] = v;
21
+ });
22
+ var __importStar = (this && this.__importStar) || function (mod) {
23
+ if (mod && mod.__esModule) return mod;
24
+ var result = {};
25
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26
+ __setModuleDefault(result, mod);
27
+ return result;
28
+ };
6
29
  var __importDefault = (this && this.__importDefault) || function (mod) {
7
30
  return (mod && mod.__esModule) ? mod : { "default": mod };
8
31
  };
@@ -34,9 +57,27 @@ const commandLineUtils_1 = require("./src/utils/commandLineUtils");
34
57
  const DefaultProviderInstaller_1 = require("./src/utils/DefaultProviderInstaller");
35
58
  const authManager_1 = require("./src/authManager");
36
59
  const codeGeneratorManager_1 = require("./src/codeGeneratorManager");
60
+ const Sentry = __importStar(require("@sentry/node"));
61
+ const profiling_node_1 = require("@sentry/profiling-node");
62
+ Sentry.init({
63
+ dsn: 'https://0b7cc946d82c591473d6f95fff5e210b@o4505820837249024.ingest.sentry.io/4506212692000768',
64
+ enabled: process.env.NODE_ENV !== 'development',
65
+ // Performance Monitoring
66
+ tracesSampleRate: 1.0,
67
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
68
+ profilesSampleRate: 1.0,
69
+ });
37
70
  let currentServer = null;
38
71
  function createServer() {
39
72
  const app = (0, express_1.default)();
73
+ Sentry.addIntegration(new Sentry.Integrations.Http({ tracing: true }));
74
+ Sentry.addIntegration(new Sentry.Integrations.Express({ app }));
75
+ // @ts-ignore for some reason this doesn't match the type in TS
76
+ Sentry.addIntegration(new profiling_node_1.ProfilingIntegration());
77
+ // The request handler must be the first middleware on the app
78
+ app.use(Sentry.Handlers.requestHandler());
79
+ // TracingHandler creates a trace for every incoming request
80
+ app.use(Sentry.Handlers.tracingHandler());
40
81
  app.use('/traffic', routes_1.default);
41
82
  app.use('/proxy', routes_2.default);
42
83
  app.use('/config', routes_3.default);
@@ -67,6 +108,7 @@ function createServer() {
67
108
  error: 'Unknown',
68
109
  });
69
110
  });
111
+ app.use(Sentry.Handlers.errorHandler());
70
112
  /**
71
113
  * Central error handler, allows us to return a consistent JSON response wrapper with the error.
72
114
  */
package/dist/esm/index.js CHANGED
@@ -3,6 +3,29 @@
3
3
  * Copyright 2023 Kapeta Inc.
4
4
  * SPDX-License-Identifier: BUSL-1.1
5
5
  */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
19
+ }) : function(o, v) {
20
+ o["default"] = v;
21
+ });
22
+ var __importStar = (this && this.__importStar) || function (mod) {
23
+ if (mod && mod.__esModule) return mod;
24
+ var result = {};
25
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26
+ __setModuleDefault(result, mod);
27
+ return result;
28
+ };
6
29
  var __importDefault = (this && this.__importDefault) || function (mod) {
7
30
  return (mod && mod.__esModule) ? mod : { "default": mod };
8
31
  };
@@ -34,9 +57,27 @@ const commandLineUtils_1 = require("./src/utils/commandLineUtils");
34
57
  const DefaultProviderInstaller_1 = require("./src/utils/DefaultProviderInstaller");
35
58
  const authManager_1 = require("./src/authManager");
36
59
  const codeGeneratorManager_1 = require("./src/codeGeneratorManager");
60
+ const Sentry = __importStar(require("@sentry/node"));
61
+ const profiling_node_1 = require("@sentry/profiling-node");
62
+ Sentry.init({
63
+ dsn: 'https://0b7cc946d82c591473d6f95fff5e210b@o4505820837249024.ingest.sentry.io/4506212692000768',
64
+ enabled: process.env.NODE_ENV !== 'development',
65
+ // Performance Monitoring
66
+ tracesSampleRate: 1.0,
67
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
68
+ profilesSampleRate: 1.0,
69
+ });
37
70
  let currentServer = null;
38
71
  function createServer() {
39
72
  const app = (0, express_1.default)();
73
+ Sentry.addIntegration(new Sentry.Integrations.Http({ tracing: true }));
74
+ Sentry.addIntegration(new Sentry.Integrations.Express({ app }));
75
+ // @ts-ignore for some reason this doesn't match the type in TS
76
+ Sentry.addIntegration(new profiling_node_1.ProfilingIntegration());
77
+ // The request handler must be the first middleware on the app
78
+ app.use(Sentry.Handlers.requestHandler());
79
+ // TracingHandler creates a trace for every incoming request
80
+ app.use(Sentry.Handlers.tracingHandler());
40
81
  app.use('/traffic', routes_1.default);
41
82
  app.use('/proxy', routes_2.default);
42
83
  app.use('/config', routes_3.default);
@@ -67,6 +108,7 @@ function createServer() {
67
108
  error: 'Unknown',
68
109
  });
69
110
  });
111
+ app.use(Sentry.Handlers.errorHandler());
70
112
  /**
71
113
  * Central error handler, allows us to return a consistent JSON response wrapper with the error.
72
114
  */
package/index.ts CHANGED
@@ -31,6 +31,17 @@ import { ensureCLI, ensureCLICommands } from './src/utils/commandLineUtils';
31
31
  import { defaultProviderInstaller } from './src/utils/DefaultProviderInstaller';
32
32
  import { authManager } from './src/authManager';
33
33
  import { codeGeneratorManager } from './src/codeGeneratorManager';
34
+ import * as Sentry from '@sentry/node';
35
+ import { ProfilingIntegration } from '@sentry/profiling-node';
36
+
37
+ Sentry.init({
38
+ dsn: 'https://0b7cc946d82c591473d6f95fff5e210b@o4505820837249024.ingest.sentry.io/4506212692000768',
39
+ enabled: process.env.NODE_ENV !== 'development',
40
+ // Performance Monitoring
41
+ tracesSampleRate: 1.0,
42
+ // Set sampling rate for profiling - this is relative to tracesSampleRate
43
+ profilesSampleRate: 1.0,
44
+ });
34
45
 
35
46
  export type LocalClusterService = HTTP.Server & { host?: string; port?: number };
36
47
 
@@ -40,6 +51,18 @@ let currentServer: LocalClusterService | null = null;
40
51
 
41
52
  function createServer() {
42
53
  const app = express();
54
+
55
+ Sentry.addIntegration(new Sentry.Integrations.Http({ tracing: true }));
56
+ Sentry.addIntegration(new Sentry.Integrations.Express({ app }));
57
+ // @ts-ignore for some reason this doesn't match the type in TS
58
+ Sentry.addIntegration(new ProfilingIntegration());
59
+
60
+ // The request handler must be the first middleware on the app
61
+ app.use(Sentry.Handlers.requestHandler());
62
+
63
+ // TracingHandler creates a trace for every incoming request
64
+ app.use(Sentry.Handlers.tracingHandler());
65
+
43
66
  app.use('/traffic', TrafficRoutes);
44
67
  app.use('/proxy', ProxyRoutes);
45
68
  app.use('/config', ConfigRoutes);
@@ -74,6 +97,8 @@ function createServer() {
74
97
  });
75
98
  });
76
99
 
100
+ app.use(Sentry.Handlers.errorHandler());
101
+
77
102
  /**
78
103
  * Central error handler, allows us to return a consistent JSON response wrapper with the error.
79
104
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kapeta/local-cluster-service",
3
- "version": "0.25.0",
3
+ "version": "0.25.2",
4
4
  "description": "Manages configuration, ports and service discovery for locally running Kapeta systems",
5
5
  "type": "commonjs",
6
6
  "exports": {
@@ -55,7 +55,9 @@
55
55
  "@kapeta/nodejs-utils": "<2",
56
56
  "@kapeta/schemas": "<2",
57
57
  "@kapeta/sdk-config": "<2",
58
- "@kapeta/web-microfrontend": "^0.2.1",
58
+ "@kapeta/web-microfrontend": "<2",
59
+ "@sentry/node": "^7.80.0",
60
+ "@sentry/profiling-node": "^1.2.6",
59
61
  "@types/dockerode": "^3.3.19",
60
62
  "@types/stream-json": "^1.7.3",
61
63
  "async-lock": "^1.4.0",
package/tsconfig.json CHANGED
@@ -4,7 +4,8 @@
4
4
  "module": "node16",
5
5
  "moduleResolution": "node16",
6
6
  "outDir": "./dist",
7
- "declaration": true
7
+ "declaration": true,
8
+ "strict": true
8
9
  },
9
10
  "ts-node": {
10
11
  "files": true