securenow 5.0.3 → 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 +1 -1
- package/cli.js +1 -1
- package/docs/ENVIRONMENT-VARIABLES.md +3 -3
- package/docs/LOGGING-GUIDE.md +1 -1
- package/examples/nextjs-env-example.txt +1 -1
- package/nextjs.d.ts +1 -1
- package/nextjs.js +1 -1
- package/package.json +1 -1
- package/postinstall.js +1 -1
- package/tracing.js +6 -5
- package/web-vite.mjs +1 -1
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:
|
|
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:
|
|
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 | `
|
|
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:** `
|
|
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: `
|
|
543
|
+
5. Default: `https://freetrial.securenow.ai:4318` (lowest priority)
|
|
544
544
|
|
|
545
545
|
---
|
|
546
546
|
|
package/docs/LOGGING-GUIDE.md
CHANGED
|
@@ -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
|
|
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:
|
|
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 || '
|
|
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
|
-
'
|
|
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
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:
|
|
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'))
|
|
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({
|
|
@@ -265,12 +264,11 @@ if (loggingEnabled) {
|
|
|
265
264
|
headers
|
|
266
265
|
});
|
|
267
266
|
|
|
267
|
+
const batchLogProcessor = new BatchLogRecordProcessor(logExporter);
|
|
268
268
|
loggerProvider = new LoggerProvider({
|
|
269
269
|
resource: sharedResource,
|
|
270
|
-
processors: [new BatchLogRecordProcessor(logExporter)],
|
|
271
270
|
});
|
|
272
|
-
|
|
273
|
-
globalLogger = loggerProvider.getLogger('securenow', '1.0.0');
|
|
271
|
+
loggerProvider.addLogRecordProcessor(batchLogProcessor);
|
|
274
272
|
}
|
|
275
273
|
|
|
276
274
|
// -------- SDK --------
|
|
@@ -310,7 +308,10 @@ const sdk = new NodeSDK({
|
|
|
310
308
|
}
|
|
311
309
|
})();
|
|
312
310
|
|
|
311
|
+
let shuttingDown = false;
|
|
313
312
|
async function safeShutdown(sig) {
|
|
313
|
+
if (shuttingDown) return;
|
|
314
|
+
shuttingDown = true;
|
|
314
315
|
try {
|
|
315
316
|
await Promise.resolve(sdk.shutdown?.());
|
|
316
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') || '
|
|
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`;
|