@webtypen/webframez-core 0.3.15 → 0.3.17

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.
@@ -23,7 +23,6 @@ const QueueStopCommand_1 = require("./Commands/QueueStopCommand");
23
23
  const QueueLogCommand_1 = require("./Commands/QueueLogCommand");
24
24
  const QueueWorkerAutorestartCommand_1 = require("./Commands/QueueWorkerAutorestartCommand");
25
25
  const info_1 = require("./info");
26
- const SigNozTelemetry_1 = require("./Telemetry/SigNozTelemetry");
27
26
  class ConsoleApplication {
28
27
  constructor() {
29
28
  this.systemCommands = [
@@ -45,9 +44,9 @@ class ConsoleApplication {
45
44
  Config_1.Config.register(key, options.config[key]);
46
45
  }
47
46
  }
48
- if (options && options.signoz) {
49
- void SigNozTelemetry_1.SigNozTelemetry.init(options.signoz);
50
- }
47
+ // if (options && options.signoz) {
48
+ // void SigNozTelemetry.init(options.signoz);
49
+ // }
51
50
  if (options && options.datatables) {
52
51
  DatatableRegistry_1.DatatableRegistry.registerMany(options.datatables);
53
52
  }
@@ -171,10 +171,29 @@ class RouterFacade {
171
171
  */
172
172
  extractParams(path, match) {
173
173
  const params = {};
174
- const paramNames = path.match(/\/:([\w]+)\??/g) || [];
174
+ const paramNames = path.match(/\/:(\[\w]+)\??/g) || [];
175
+ const wildcards = path.match(/\/\*\*|\/\*|\*\*/g) || [];
176
+ // Extract named parameters
175
177
  paramNames.forEach((param, index) => {
176
178
  params[param.substring(2).replace("?", "")] = match[index + 1] || null;
177
179
  });
180
+ // Extract wildcard parameters
181
+ let wildcardIndex = paramNames.length + 1;
182
+ wildcards.forEach((wildcard, index) => {
183
+ if (wildcard === '/**') {
184
+ params['wildcard'] = match[wildcardIndex] || '';
185
+ }
186
+ else if (wildcard === '/*') {
187
+ params['splat'] = match[wildcardIndex] || '';
188
+ }
189
+ else if (wildcard === '**') {
190
+ params['wildcard'] = match[wildcardIndex] || '';
191
+ }
192
+ else if (wildcard === '*') {
193
+ params['splat'] = match[wildcardIndex] || '';
194
+ }
195
+ wildcardIndex++;
196
+ });
178
197
  return params;
179
198
  }
180
199
  /**
@@ -195,6 +214,10 @@ class RouterFacade {
195
214
  routeObj.path
196
215
  .replace(/\/:\w+\?/g, "(?:/([^/]+))?")
197
216
  .replace(/\/:\w+/g, "/([^/]+)")
217
+ .replace(/\/\*\*/g, "/(.*)") // Catchall wildcard: /**
218
+ .replace(/\/\*/g, "/([^/]*)")
219
+ .replace(/\*\*/g, "(.*)")
220
+ .replace(/\*/g, "([^/]*)")
198
221
  .replace(/\//g, "\\/") +
199
222
  "$";
200
223
  const match = url.match(regex);
@@ -1,33 +0,0 @@
1
- export interface SigNozOptions {
2
- enabled?: boolean;
3
- serviceName?: string;
4
- endpoint?: string;
5
- apiKey?: string;
6
- headers?: Record<string, string>;
7
- environment?: string;
8
- resourceAttributes?: Record<string, unknown>;
9
- samplingRatio?: number;
10
- instrumentations?: any[];
11
- autoInstrumentations?: boolean;
12
- autoInstrumentationConfig?: Record<string, unknown>;
13
- logInitialization?: boolean;
14
- }
15
- export declare class SigNozTelemetry {
16
- private static sdk;
17
- private static initPromise;
18
- private static shutdownRegistered;
19
- private static readonly missingDependencies;
20
- private static readonly shutdownListener;
21
- static init(options?: SigNozOptions): Promise<void>;
22
- private static initialize;
23
- static shutdown(): Promise<void>;
24
- private static safeImport;
25
- private static ensureEndpoint;
26
- private static warnMissingDependency;
27
- private static registerShutdownHooks;
28
- private static getProcess;
29
- private static getEnv;
30
- private static getConsole;
31
- private static logInfo;
32
- private static logWarn;
33
- }
@@ -1,253 +1,235 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- Object.defineProperty(exports, "__esModule", { value: true });
35
- exports.SigNozTelemetry = void 0;
36
- const Config_1 = require("../Config");
37
- class SigNozTelemetry {
38
- static init(options) {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- if (!options || options.enabled === false) {
41
- return;
42
- }
43
- if (this.sdk) {
44
- return;
45
- }
46
- if (this.initPromise) {
47
- yield this.initPromise;
48
- return;
49
- }
50
- const initialization = (() => __awaiter(this, void 0, void 0, function* () {
51
- try {
52
- yield this.initialize(options);
53
- }
54
- catch (error) {
55
- this.logWarn("[SigNoz] Initialization failed:", error);
56
- }
57
- }))();
58
- this.initPromise = initialization;
59
- try {
60
- yield initialization;
61
- }
62
- finally {
63
- this.initPromise = null;
64
- }
65
- });
66
- }
67
- static initialize(options) {
68
- return __awaiter(this, void 0, void 0, function* () {
69
- const sdkModule = yield this.safeImport("@opentelemetry/sdk-node");
70
- const traceExporterModule = yield this.safeImport("@opentelemetry/exporter-trace-otlp-http");
71
- const resourcesModule = yield this.safeImport("@opentelemetry/resources");
72
- const semanticModule = yield this.safeImport("@opentelemetry/semantic-conventions");
73
- if (!(sdkModule === null || sdkModule === void 0 ? void 0 : sdkModule.NodeSDK) || !(traceExporterModule === null || traceExporterModule === void 0 ? void 0 : traceExporterModule.OTLPTraceExporter) || !(resourcesModule === null || resourcesModule === void 0 ? void 0 : resourcesModule.Resource) || !(semanticModule === null || semanticModule === void 0 ? void 0 : semanticModule.SemanticResourceAttributes)) {
74
- throw new Error("OpenTelemetry packages are missing. Install '@opentelemetry/sdk-node', '@opentelemetry/exporter-trace-otlp-http', '@opentelemetry/resources' and '@opentelemetry/semantic-conventions'.");
75
- }
76
- const serviceName = options.serviceName ||
77
- Config_1.Config.get("application.serviceName") ||
78
- Config_1.Config.get("application.name") ||
79
- this.getEnv("SIGNOZ_SERVICE_NAME") ||
80
- this.getEnv("OTEL_SERVICE_NAME") ||
81
- "webframez-service";
82
- const environment = options.environment ||
83
- Config_1.Config.get("application.environment") ||
84
- this.getEnv("SIGNOZ_ENVIRONMENT") ||
85
- this.getEnv("NODE_ENV") ||
86
- "development";
87
- const traceEndpoint = this.ensureEndpoint(options.endpoint ||
88
- this.getEnv("SIGNOZ_ENDPOINT") ||
89
- this.getEnv("OTEL_EXPORTER_OTLP_TRACES_ENDPOINT") ||
90
- this.getEnv("OTEL_EXPORTER_OTLP_ENDPOINT"), "http://localhost:4318", "/v1/traces");
91
- const headers = Object.assign({}, (options.headers || {}));
92
- const apiKey = options.apiKey || this.getEnv("SIGNOZ_API_KEY");
93
- if (apiKey && !headers["signoz-access-token"]) {
94
- headers["signoz-access-token"] = apiKey;
95
- }
96
- const { NodeSDK } = sdkModule;
97
- const { OTLPTraceExporter } = traceExporterModule;
98
- const { Resource } = resourcesModule;
99
- const { SemanticResourceAttributes } = semanticModule;
100
- const resourceAttributes = {
101
- [SemanticResourceAttributes.SERVICE_NAME]: serviceName,
102
- [SemanticResourceAttributes.DEPLOYMENT_ENVIRONMENT]: environment,
103
- };
104
- if (options.resourceAttributes) {
105
- Object.assign(resourceAttributes, options.resourceAttributes);
106
- }
107
- const resource = new Resource(resourceAttributes);
108
- let instrumentations = options.instrumentations ? [...options.instrumentations] : [];
109
- if (instrumentations.length === 0 && options.autoInstrumentations !== false) {
110
- const autoModule = yield this.safeImport("@opentelemetry/auto-instrumentations-node");
111
- if (autoModule === null || autoModule === void 0 ? void 0 : autoModule.getNodeAutoInstrumentations) {
112
- instrumentations = [autoModule.getNodeAutoInstrumentations(options.autoInstrumentationConfig || {})];
113
- }
114
- else {
115
- this.warnMissingDependency("@opentelemetry/auto-instrumentations-node");
116
- }
117
- }
118
- let traceSampler;
119
- if (typeof options.samplingRatio === "number") {
120
- const samplerModule = yield this.safeImport("@opentelemetry/sdk-trace-base");
121
- if ((samplerModule === null || samplerModule === void 0 ? void 0 : samplerModule.ParentBasedSampler) && (samplerModule === null || samplerModule === void 0 ? void 0 : samplerModule.TraceIdRatioBasedSampler)) {
122
- const ratio = Math.min(Math.max(options.samplingRatio, 0), 1);
123
- traceSampler = new samplerModule.ParentBasedSampler({
124
- root: new samplerModule.TraceIdRatioBasedSampler(ratio),
125
- });
126
- }
127
- else {
128
- this.warnMissingDependency("@opentelemetry/sdk-trace-base");
129
- }
130
- }
131
- const traceExporter = new OTLPTraceExporter({
132
- url: traceEndpoint,
133
- headers,
134
- });
135
- const sdkOptions = {
136
- resource,
137
- traceExporter,
138
- };
139
- if (instrumentations && instrumentations.length > 0) {
140
- sdkOptions.instrumentations = instrumentations;
141
- }
142
- if (traceSampler) {
143
- sdkOptions.traceSampler = traceSampler;
144
- }
145
- this.sdk = new NodeSDK(sdkOptions);
146
- yield this.sdk.start();
147
- if (options.logInitialization !== false) {
148
- this.logInfo(`[SigNoz] Telemetry enabled (service="${serviceName}", endpoint="${traceEndpoint}")`);
149
- }
150
- this.registerShutdownHooks();
151
- });
152
- }
153
- static shutdown() {
154
- return __awaiter(this, void 0, void 0, function* () {
155
- if (!this.sdk) {
156
- return;
157
- }
158
- const sdkToShutdown = this.sdk;
159
- this.sdk = null;
160
- try {
161
- yield sdkToShutdown.shutdown();
162
- }
163
- catch (error) {
164
- this.logWarn("[SigNoz] Shutdown failed:", error);
165
- }
166
- });
167
- }
168
- static safeImport(moduleName) {
169
- return __awaiter(this, void 0, void 0, function* () {
170
- var _a;
171
- try {
172
- const module = yield (_a = moduleName, Promise.resolve().then(() => __importStar(require(_a))));
173
- return module;
174
- }
175
- catch (error) {
176
- if (error && (error.code === "MODULE_NOT_FOUND" || error.code === "ERR_MODULE_NOT_FOUND")) {
177
- return null;
178
- }
179
- throw error;
180
- }
181
- });
182
- }
183
- static ensureEndpoint(value, fallbackHost, defaultPath) {
184
- const base = value && value.trim() !== "" ? value.trim() : fallbackHost;
185
- if (base.includes("/v1/") || base.endsWith(defaultPath)) {
186
- return base;
187
- }
188
- return `${base.replace(/\/$/, "")}${defaultPath}`;
189
- }
190
- static warnMissingDependency(name) {
191
- if (this.missingDependencies.has(name)) {
192
- return;
193
- }
194
- this.missingDependencies.add(name);
195
- this.logWarn(`[SigNoz] Optional package "${name}" not found. Install it to enable the related feature.`);
196
- }
197
- static registerShutdownHooks() {
198
- if (this.shutdownRegistered) {
199
- return;
200
- }
201
- const nodeProcess = this.getProcess();
202
- if (!nodeProcess) {
203
- return;
204
- }
205
- nodeProcess.once("beforeExit", this.shutdownListener);
206
- nodeProcess.once("exit", this.shutdownListener);
207
- this.shutdownRegistered = true;
208
- }
209
- static getProcess() {
210
- if (typeof globalThis === "undefined") {
211
- return undefined;
212
- }
213
- const candidate = globalThis.process;
214
- if (candidate && typeof candidate.once === "function") {
215
- return candidate;
216
- }
217
- return undefined;
218
- }
219
- static getEnv(key) {
220
- const nodeProcess = this.getProcess();
221
- if (!nodeProcess || !nodeProcess.env) {
222
- return undefined;
223
- }
224
- const value = nodeProcess.env[key];
225
- return typeof value === "string" ? value : undefined;
226
- }
227
- static getConsole() {
228
- if (typeof globalThis === "undefined") {
229
- return undefined;
230
- }
231
- return globalThis.console;
232
- }
233
- static logInfo(...args) {
234
- const target = this.getConsole();
235
- if (target && typeof target.info === "function") {
236
- target.info(...args);
237
- }
238
- }
239
- static logWarn(...args) {
240
- const target = this.getConsole();
241
- if (target && typeof target.warn === "function") {
242
- target.warn(...args);
243
- }
244
- }
245
- }
246
- exports.SigNozTelemetry = SigNozTelemetry;
247
- SigNozTelemetry.sdk = null;
248
- SigNozTelemetry.initPromise = null;
249
- SigNozTelemetry.shutdownRegistered = false;
250
- SigNozTelemetry.missingDependencies = new Set();
251
- SigNozTelemetry.shutdownListener = () => {
252
- void SigNozTelemetry.shutdown();
253
- };
2
+ // import { NodeSDK } from "@opentelemetry/sdk-node";
3
+ // import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
4
+ // import { Resource } from "@opentelemetry/resources";
5
+ // import { SemanticResourceAttributes } from "@opentelemetry/semantic-conventions";
6
+ // import { ParentBasedSampler, TraceIdRatioBasedSampler } from "@opentelemetry/sdk-trace-base";
7
+ // import { Config } from "../Config";
8
+ // export interface SigNozOptions {
9
+ // enabled?: boolean;
10
+ // serviceName?: string;
11
+ // endpoint?: string;
12
+ // apiKey?: string;
13
+ // headers?: Record<string, string>;
14
+ // environment?: string;
15
+ // resourceAttributes?: Record<string, unknown>;
16
+ // samplingRatio?: number;
17
+ // instrumentations?: any[];
18
+ // autoInstrumentations?: boolean;
19
+ // autoInstrumentationConfig?: Record<string, unknown>;
20
+ // logInitialization?: boolean;
21
+ // }
22
+ // export class SigNozTelemetry {
23
+ // private static sdk: NodeSDK | null = null;
24
+ // private static initPromise: Promise<void> | null = null;
25
+ // private static shutdownRegistered = false;
26
+ // private static readonly missingDependencies = new Set<string>();
27
+ // private static readonly shutdownListener = () => {
28
+ // void SigNozTelemetry.shutdown();
29
+ // };
30
+ // static async init(options?: SigNozOptions): Promise<void> {
31
+ // if (!options || options.enabled === false) {
32
+ // return;
33
+ // }
34
+ // if (this.sdk) {
35
+ // return;
36
+ // }
37
+ // if (this.initPromise) {
38
+ // await this.initPromise;
39
+ // return;
40
+ // }
41
+ // console.log("signoz init 1");
42
+ // const initialization = (async () => {
43
+ // try {
44
+ // await this.initialize(options);
45
+ // } catch (error) {
46
+ // this.logWarn("[SigNoz] Initialization failed:", error);
47
+ // }
48
+ // })();
49
+ // console.log("signoz init 2");
50
+ // this.initPromise = initialization;
51
+ // try {
52
+ // await initialization;
53
+ // } finally {
54
+ // this.initPromise = null;
55
+ // }
56
+ // console.log("signoz init finish");
57
+ // }
58
+ // private static async initialize(options: SigNozOptions): Promise<void> {
59
+ // console.log("signoz initialize 1");
60
+ // const serviceName =
61
+ // options.serviceName ||
62
+ // (Config.get("application.serviceName") as string) ||
63
+ // (Config.get("application.name") as string) ||
64
+ // this.getEnv("SIGNOZ_SERVICE_NAME") ||
65
+ // this.getEnv("OTEL_SERVICE_NAME") ||
66
+ // "webframez-service";
67
+ // const environment =
68
+ // options.environment ||
69
+ // (Config.get("application.environment") as string) ||
70
+ // this.getEnv("SIGNOZ_ENVIRONMENT") ||
71
+ // this.getEnv("NODE_ENV") ||
72
+ // "development";
73
+ // const traceEndpoint = this.ensureEndpoint(
74
+ // options.endpoint ||
75
+ // this.getEnv("SIGNOZ_ENDPOINT") ||
76
+ // this.getEnv("OTEL_EXPORTER_OTLP_TRACES_ENDPOINT") ||
77
+ // this.getEnv("OTEL_EXPORTER_OTLP_ENDPOINT"),
78
+ // "http://localhost:4318",
79
+ // "/v1/traces"
80
+ // );
81
+ // console.log("signoz initialize 2");
82
+ // const headers = { ...(options.headers || {}) };
83
+ // const apiKey = options.apiKey || this.getEnv("SIGNOZ_API_KEY");
84
+ // if (apiKey && !headers["signoz-access-token"]) {
85
+ // headers["signoz-access-token"] = apiKey;
86
+ // }
87
+ // const resourceAttributes: Record<string, unknown> = {
88
+ // [SemanticResourceAttributes.SERVICE_NAME]: serviceName,
89
+ // [SemanticResourceAttributes.DEPLOYMENT_ENVIRONMENT]: environment,
90
+ // };
91
+ // if (options.resourceAttributes) {
92
+ // Object.assign(resourceAttributes, options.resourceAttributes);
93
+ // }
94
+ // console.log("signoz initialize 3");
95
+ // const resource = new Resource(resourceAttributes);
96
+ // let instrumentations = options.instrumentations ? [...options.instrumentations] : [];
97
+ // if (instrumentations.length === 0 && options.autoInstrumentations !== false) {
98
+ // const autoInstrumentation = this.loadAutoInstrumentations(options.autoInstrumentationConfig || {});
99
+ // if (autoInstrumentation) {
100
+ // instrumentations = [autoInstrumentation];
101
+ // }
102
+ // }
103
+ // console.log("signoz initialize 4");
104
+ // let traceSampler: ParentBasedSampler | undefined;
105
+ // if (typeof options.samplingRatio === "number") {
106
+ // const ratio = Math.min(Math.max(options.samplingRatio, 0), 1);
107
+ // traceSampler = new ParentBasedSampler({
108
+ // root: new TraceIdRatioBasedSampler(ratio),
109
+ // });
110
+ // }
111
+ // console.log("signoz initialize 5");
112
+ // const traceExporter = new OTLPTraceExporter({
113
+ // url: traceEndpoint,
114
+ // headers,
115
+ // });
116
+ // const sdkOptions: {
117
+ // resource: Resource;
118
+ // traceExporter: OTLPTraceExporter;
119
+ // instrumentations?: any[];
120
+ // traceSampler?: ParentBasedSampler;
121
+ // } = {
122
+ // resource,
123
+ // traceExporter,
124
+ // };
125
+ // if (instrumentations.length > 0) {
126
+ // sdkOptions.instrumentations = instrumentations;
127
+ // }
128
+ // if (traceSampler) {
129
+ // sdkOptions.traceSampler = traceSampler;
130
+ // }
131
+ // console.log("signoz initialize 6");
132
+ // this.sdk = new NodeSDK(sdkOptions as any);
133
+ // await this.sdk.start();
134
+ // if (options.logInitialization !== false) {
135
+ // this.logInfo(`[SigNoz] Telemetry enabled (service="${serviceName}", endpoint="${traceEndpoint}")`);
136
+ // }
137
+ // console.log("signoz initialize 7");
138
+ // this.registerShutdownHooks();
139
+ // console.log("signoz initialize 8");
140
+ // }
141
+ // static async shutdown(): Promise<void> {
142
+ // if (!this.sdk) {
143
+ // return;
144
+ // }
145
+ // const sdkToShutdown = this.sdk;
146
+ // this.sdk = null;
147
+ // try {
148
+ // await sdkToShutdown.shutdown();
149
+ // } catch (error) {
150
+ // this.logWarn("[SigNoz] Shutdown failed:", error);
151
+ // }
152
+ // }
153
+ // private static ensureEndpoint(value: string | undefined, fallbackHost: string, defaultPath: string): string {
154
+ // const base = value && value.trim() !== "" ? value.trim() : fallbackHost;
155
+ // if (base.includes("/v1/") || base.endsWith(defaultPath)) {
156
+ // return base;
157
+ // }
158
+ // return `${base.replace(/\/$/, "")}${defaultPath}`;
159
+ // }
160
+ // private static warnMissingDependency(name: string) {
161
+ // if (this.missingDependencies.has(name)) {
162
+ // return;
163
+ // }
164
+ // this.missingDependencies.add(name);
165
+ // this.logWarn(`[SigNoz] Optional package "${name}" not found. Install it to enable the related feature.`);
166
+ // }
167
+ // private static loadAutoInstrumentations(config: Record<string, unknown>): any | null {
168
+ // if (typeof require !== "function") {
169
+ // return null;
170
+ // }
171
+ // try {
172
+ // // eslint-disable-next-line @typescript-eslint/no-var-requires,@typescript-eslint/no-unsafe-assignment
173
+ // const module = require("@opentelemetry/auto-instrumentations-node");
174
+ // if (module && typeof module.getNodeAutoInstrumentations === "function") {
175
+ // return module.getNodeAutoInstrumentations(config);
176
+ // }
177
+ // this.warnMissingDependency("@opentelemetry/auto-instrumentations-node");
178
+ // return null;
179
+ // } catch (error: any) {
180
+ // if (error && (error.code === "MODULE_NOT_FOUND" || error.code === "ERR_MODULE_NOT_FOUND")) {
181
+ // this.warnMissingDependency("@opentelemetry/auto-instrumentations-node");
182
+ // return null;
183
+ // }
184
+ // throw error;
185
+ // }
186
+ // }
187
+ // private static registerShutdownHooks() {
188
+ // if (this.shutdownRegistered) {
189
+ // return;
190
+ // }
191
+ // const nodeProcess = this.getProcess();
192
+ // if (!nodeProcess) {
193
+ // return;
194
+ // }
195
+ // nodeProcess.once("beforeExit", this.shutdownListener);
196
+ // nodeProcess.once("exit", this.shutdownListener);
197
+ // this.shutdownRegistered = true;
198
+ // }
199
+ // private static getProcess(): any {
200
+ // if (typeof globalThis === "undefined") {
201
+ // return undefined;
202
+ // }
203
+ // const candidate = (globalThis as any).process;
204
+ // if (candidate && typeof candidate.once === "function") {
205
+ // return candidate;
206
+ // }
207
+ // return undefined;
208
+ // }
209
+ // private static getEnv(key: string): string | undefined {
210
+ // const nodeProcess = this.getProcess();
211
+ // if (!nodeProcess || !nodeProcess.env) {
212
+ // return undefined;
213
+ // }
214
+ // const value = nodeProcess.env[key];
215
+ // return typeof value === "string" ? value : undefined;
216
+ // }
217
+ // private static getConsole(): any {
218
+ // if (typeof globalThis === "undefined") {
219
+ // return undefined;
220
+ // }
221
+ // return (globalThis as any).console;
222
+ // }
223
+ // private static logInfo(...args: unknown[]) {
224
+ // const target = this.getConsole();
225
+ // if (target && typeof target.info === "function") {
226
+ // target.info(...args);
227
+ // }
228
+ // }
229
+ // private static logWarn(...args: unknown[]) {
230
+ // const target = this.getConsole();
231
+ // if (target && typeof target.warn === "function") {
232
+ // target.warn(...args);
233
+ // }
234
+ // }
235
+ // }
@@ -11,7 +11,7 @@ const Router_1 = require("./Router/Router");
11
11
  const QueueJobsRegisty_1 = require("./Queue/QueueJobsRegisty");
12
12
  const DatatableRegistry_1 = require("./Datatable/DatatableRegistry");
13
13
  const ModulesLoader_1 = require("./Modules/ModulesLoader");
14
- const SigNozTelemetry_1 = require("./Telemetry/SigNozTelemetry");
14
+ // import { SigNozTelemetry } from "./Telemetry/SigNozTelemetry";
15
15
  class WebApplication {
16
16
  constructor() {
17
17
  this.modulesLoader = null;
@@ -25,9 +25,9 @@ class WebApplication {
25
25
  Config_1.Config.register(key, options.config[key]);
26
26
  }
27
27
  }
28
- if (options && options.signoz) {
29
- void SigNozTelemetry_1.SigNozTelemetry.init(options.signoz);
30
- }
28
+ // if (options && options.signoz) {
29
+ // void SigNozTelemetry.init(options.signoz);
30
+ // }
31
31
  this.modulesLoader = new ModulesLoader_1.ModulesLoader();
32
32
  this.modulesLoader.load(options && options.modules ? options.modules : []);
33
33
  if (options && options.kernel) {
@@ -51,9 +51,9 @@ class WebApplication {
51
51
  this.server = http_1.default.createServer((req, res) => {
52
52
  Router_1.Router.handleRequest(req, res);
53
53
  });
54
- this.server.on("close", () => {
55
- void SigNozTelemetry_1.SigNozTelemetry.shutdown();
56
- });
54
+ // this.server.on("close", () => {
55
+ // void SigNozTelemetry.shutdown();
56
+ // });
57
57
  this.server.listen(port, () => {
58
58
  const runtimeConsole = typeof globalThis !== "undefined" ? globalThis.console : undefined;
59
59
  if (runtimeConsole && typeof runtimeConsole.log === "function") {