securenow 5.0.4 → 5.0.5

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/README.md CHANGED
@@ -98,7 +98,7 @@ pnpm add securenow
98
98
  SECURENOW_APPID=my-app-name
99
99
 
100
100
  # Optional: Your SigNoz/OTLP collector endpoint
101
- # Default: http://46.62.173.237:4318
101
+ # Default: https://freetrial.securenow.ai:4318
102
102
  SECURENOW_INSTANCE=http://your-signoz-server:4318
103
103
 
104
104
  # Optional: Enable Logging
package/cli.js CHANGED
@@ -59,7 +59,7 @@ export function register() {
59
59
  SECURENOW_APPID=my-nextjs-app
60
60
 
61
61
  # Optional: Your SigNoz/OpenTelemetry collector endpoint
62
- # Default: http://46.62.173.237:4318
62
+ # Default: https://freetrial.securenow.ai:4318
63
63
  SECURENOW_INSTANCE=http://your-signoz-server:4318
64
64
 
65
65
  # Optional: API key or authentication headers
@@ -9,7 +9,7 @@ Complete reference for all environment variables supported by SecureNow.
9
9
  | Variable | Type | Default | Description |
10
10
  |----------|------|---------|-------------|
11
11
  | **SECURENOW_APPID** | Required | - | Application identifier / service name |
12
- | **SECURENOW_INSTANCE** | Required | `http://46.62.173.237:4318` | OTLP collector base URL |
12
+ | **SECURENOW_INSTANCE** | Required | `https://freetrial.securenow.ai:4318` | OTLP collector base URL |
13
13
  | **SECURENOW_LOGGING_ENABLED** | Optional | `1` | Enable/disable logging |
14
14
  | **SECURENOW_NO_UUID** | Optional | `0` | Disable UUID suffix on service name |
15
15
  | **SECURENOW_STRICT** | Optional | `0` | Exit if APPID missing in cluster mode |
@@ -72,7 +72,7 @@ export SECURENOW_INSTANCE=http://collector.example.com:4318
72
72
  export SECURENOW_INSTANCE=https://collector.example.com:4318
73
73
  ```
74
74
 
75
- **Default:** `http://46.62.173.237:4318` (if not set)
75
+ **Default:** `https://freetrial.securenow.ai:4318` (if not set)
76
76
 
77
77
  **Notes:**
78
78
  - Used to construct traces and logs endpoints
@@ -540,7 +540,7 @@ When multiple variables are set, this is the priority order:
540
540
  2. `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` (for logs)
541
541
  3. `OTEL_EXPORTER_OTLP_ENDPOINT`
542
542
  4. `SECURENOW_INSTANCE`
543
- 5. Default: `http://46.62.173.237:4318` (lowest priority)
543
+ 5. Default: `https://freetrial.securenow.ai:4318` (lowest priority)
544
544
 
545
545
  ---
546
546
 
@@ -39,7 +39,7 @@ export SECURENOW_LOGGING_ENABLED=1
39
39
  # Required: Your app identifier
40
40
  export SECURENOW_APPID=my-app
41
41
 
42
- # Optional: Your SigNoz endpoint (defaults to http://46.62.173.237:4318)
42
+ # Optional: Your SigNoz endpoint (defaults to https://freetrial.securenow.ai:4318)
43
43
  export SECURENOW_INSTANCE=http://your-signoz-server:4318
44
44
 
45
45
  # Optional: SigNoz Cloud authentication
@@ -5,7 +5,7 @@
5
5
  SECURENOW_APPID=my-nextjs-app
6
6
 
7
7
  # Optional: Your SigNoz/OpenTelemetry collector endpoint
8
- # Default: http://46.62.173.237:4318
8
+ # Default: https://freetrial.securenow.ai:4318
9
9
  SECURENOW_INSTANCE=http://your-signoz-server:4318
10
10
 
11
11
  # Optional: API Key or authentication headers
package/nextjs.d.ts CHANGED
@@ -11,7 +11,7 @@ export interface RegisterOptions {
11
11
 
12
12
  /**
13
13
  * OTLP endpoint for traces
14
- * @default process.env.SECURENOW_INSTANCE || 'http://46.62.173.237:4318'
14
+ * @default process.env.SECURENOW_INSTANCE || 'https://freetrial.securenow.ai:4318'
15
15
  */
16
16
  endpoint?: string;
17
17
 
package/nextjs.js CHANGED
@@ -257,7 +257,7 @@ function registerSecureNow(options = {}) {
257
257
  options.endpoint ||
258
258
  env('SECURENOW_INSTANCE') ||
259
259
  env('OTEL_EXPORTER_OTLP_ENDPOINT') ||
260
- 'http://46.62.173.237:4318'
260
+ 'https://freetrial.securenow.ai:4318'
261
261
  ).replace(/\/$/, '');
262
262
 
263
263
  const tracesUrl = env('OTEL_EXPORTER_OTLP_TRACES_ENDPOINT') || `${endpointBase}/v1/traces`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "securenow",
3
- "version": "5.0.4",
3
+ "version": "5.0.5",
4
4
  "description": "OpenTelemetry instrumentation for Node.js and Next.js - Send traces and logs to SigNoz or any OTLP backend",
5
5
  "type": "commonjs",
6
6
  "main": "register.js",
package/postinstall.js CHANGED
@@ -151,7 +151,7 @@ function createEnvTemplate(targetPath) {
151
151
  SECURENOW_APPID=my-nextjs-app
152
152
 
153
153
  # Optional: Your SigNoz/OpenTelemetry collector endpoint
154
- # Default: http://46.62.173.237:4318
154
+ # Default: https://freetrial.securenow.ai:4318
155
155
  SECURENOW_INSTANCE=http://your-signoz-server:4318
156
156
 
157
157
  # Optional: API key or authentication headers
package/tracing.js CHANGED
@@ -245,7 +245,7 @@ const httpInstrumentation = new HttpInstrumentation({
245
245
  });
246
246
 
247
247
  // -------- Logging Configuration --------
248
- const loggingEnabled = String(env('SECURENOW_LOGGING_ENABLED')) !== '0' && String(env('SECURENOW_LOGGING_ENABLED')).toLowerCase() !== 'false';
248
+ const loggingEnabled = String(env('SECURENOW_LOGGING_ENABLED')) === '1' || String(env('SECURENOW_LOGGING_ENABLED')).toLowerCase() === 'true';
249
249
 
250
250
  // Create shared resource for both traces and logs
251
251
  const sharedResource = new Resource({
@@ -257,7 +257,6 @@ const sharedResource = new Resource({
257
257
 
258
258
  // Initialize LoggerProvider if logging is enabled
259
259
  let loggerProvider = null;
260
- let globalLogger = null;
261
260
 
262
261
  if (loggingEnabled) {
263
262
  const logExporter = new OTLPLogExporter({
@@ -270,8 +269,6 @@ if (loggingEnabled) {
270
269
  resource: sharedResource,
271
270
  });
272
271
  loggerProvider.addLogRecordProcessor(batchLogProcessor);
273
-
274
- globalLogger = loggerProvider.getLogger('securenow', '1.0.0');
275
272
  }
276
273
 
277
274
  // -------- SDK --------
@@ -311,7 +308,10 @@ const sdk = new NodeSDK({
311
308
  }
312
309
  })();
313
310
 
311
+ let shuttingDown = false;
314
312
  async function safeShutdown(sig) {
313
+ if (shuttingDown) return;
314
+ shuttingDown = true;
315
315
  try {
316
316
  await Promise.resolve(sdk.shutdown?.());
317
317
  if (loggerProvider) {
package/web-vite.mjs CHANGED
@@ -43,7 +43,7 @@ function parseHeaders(str?: string) {
43
43
 
44
44
  // ---- endpoints (same defaults as tracing.js) ----
45
45
  const endpointBase =
46
- (env('SECURENOW_INSTANCE') || env('OTEL_EXPORTER_OTLP_ENDPOINT') || 'http://46.62.173.237:4318')
46
+ (env('SECURENOW_INSTANCE') || env('OTEL_EXPORTER_OTLP_ENDPOINT') || 'https://freetrial.securenow.ai:4318')
47
47
  .replace(/\/$/, '');
48
48
  const tracesUrl =
49
49
  env('OTEL_EXPORTER_OTLP_TRACES_ENDPOINT') || `${endpointBase}/v1/traces`;