securenow 8.0.2 → 8.1.0

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/mcp/catalog.js CHANGED
@@ -18,7 +18,7 @@ Primary goals:
18
18
 
19
19
  Safety rules:
20
20
  - Do not print full API keys, JWTs, tokens, or local SecureNow credential files (.securenow/admin.json, .securenow/runtime.json, legacy .securenow/credentials.json, or .securenow/credentials.*.json). Mask secrets.
21
- - Do not commit secrets. Ignore only local SecureNow credential files (.securenow/admin.json, .securenow/runtime.json, .securenow/credentials.json, and .securenow/credentials.*.json); keep the .securenow/ directory itself trackable for repo-owned docs/templates.
21
+ - Keep local SecureNow credential files secret (.securenow/admin.json, .securenow/runtime.json, legacy .securenow/credentials.json, and .securenow/credentials.*.json). Do not print them; mask secrets in summaries.
22
22
  - Do not manually browse to a SecureNow auth URL. Always start auth with npx securenow login so the CLI generates the required callback and state.
23
23
  - If the browser says "Missing callback parameter", you opened the wrong URL: rerun npx securenow login from the project root.
24
24
  - Do not skip login, app selection, firewall connection, or verification unless I explicitly say to.
package/nextjs.js CHANGED
@@ -31,12 +31,12 @@
31
31
  */
32
32
 
33
33
  const { randomUUID } = require('crypto');
34
- const { defaultMetricsExporterToNone } = require('./otel-defaults');
34
+ const { nodeSdkDefaultTelemetryOptions } = require('./otel-defaults');
35
35
  const appConfig = require('./app-config');
36
36
  const { resolveClientIpWithDetails } = require('./resolve-ip');
37
37
  const otelResources = require('@opentelemetry/resources');
38
38
 
39
- defaultMetricsExporterToNone();
39
+ const nodeSdkTelemetryOptions = nodeSdkDefaultTelemetryOptions();
40
40
 
41
41
  let isRegistered = false;
42
42
 
@@ -477,6 +477,7 @@ function registerSecureNow(options = {}) {
477
477
  });
478
478
 
479
479
  const sdk = new NodeSDK({
480
+ ...nodeSdkTelemetryOptions,
480
481
  serviceName: serviceName,
481
482
  traceExporter: traceExporter,
482
483
  instrumentations: [httpInstrumentation],
@@ -20,8 +20,8 @@ import { randomUUID } from 'node:crypto';
20
20
  const nodeRequire = createRequire(import.meta.url);
21
21
  const appConfig = nodeRequire('./app-config');
22
22
  const { resolveClientIpWithDetails } = nodeRequire('./resolve-ip');
23
- const { defaultMetricsExporterToNone } = nodeRequire('./otel-defaults');
24
- defaultMetricsExporterToNone();
23
+ const { nodeSdkDefaultTelemetryOptions } = nodeRequire('./otel-defaults');
24
+ const nodeSdkTelemetryOptions = nodeSdkDefaultTelemetryOptions();
25
25
 
26
26
  const { NodeSDK } = nodeRequire('@opentelemetry/sdk-node');
27
27
  const { OTLPTraceExporter } = nodeRequire('@opentelemetry/exporter-trace-otlp-http');
@@ -219,6 +219,7 @@ export default defineNitroPlugin(async (nitroApp) => {
219
219
  const traceExporter = new OTLPTraceExporter({ url: tracesUrl, headers });
220
220
 
221
221
  const sdk = new NodeSDK({
222
+ ...nodeSdkTelemetryOptions,
222
223
  traceExporter,
223
224
  resource,
224
225
  instrumentations: [httpInstrumentation],
package/otel-defaults.js CHANGED
@@ -1,11 +1,39 @@
1
1
  'use strict';
2
2
 
3
+ function isUnset(value) {
4
+ return value == null || String(value).trim() === '';
5
+ }
6
+
7
+ function listIncludes(value, needle) {
8
+ return String(value || '')
9
+ .split(',')
10
+ .map((part) => part.trim().toLowerCase())
11
+ .includes(needle);
12
+ }
13
+
3
14
  function defaultMetricsExporterToNone(env = process.env) {
4
15
  if (!env) return false;
5
16
  const current = env.OTEL_METRICS_EXPORTER;
6
- if (current != null && String(current).trim() !== '') return false;
17
+ if (!isUnset(current)) return false;
7
18
  env.OTEL_METRICS_EXPORTER = 'none';
8
19
  return true;
9
20
  }
10
21
 
11
- module.exports = { defaultMetricsExporterToNone };
22
+ function nodeSdkDefaultTelemetryOptions(env = process.env) {
23
+ const options = {};
24
+
25
+ defaultMetricsExporterToNone(env);
26
+ if (listIncludes(env?.OTEL_METRICS_EXPORTER, 'none')) {
27
+ options.metricReaders = [];
28
+ }
29
+
30
+ // SecureNow installs its own log exporter. Without this, sdk-node falls back
31
+ // to the upstream OTEL_LOGS_EXPORTER default and tries localhost:4318.
32
+ if (env && isUnset(env.OTEL_LOGS_EXPORTER)) {
33
+ options.logRecordProcessors = [];
34
+ }
35
+
36
+ return options;
37
+ }
38
+
39
+ module.exports = { defaultMetricsExporterToNone, nodeSdkDefaultTelemetryOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "securenow",
3
- "version": "8.0.2",
3
+ "version": "8.1.0",
4
4
  "description": "OpenTelemetry instrumentation for Node.js, Next.js, and Nuxt - Send traces and logs to any OTLP-compatible backend",
5
5
  "type": "commonjs",
6
6
  "main": "register.js",
package/tracing.js CHANGED
@@ -14,8 +14,8 @@
14
14
  * Production should mount/copy tokenless runtime credentials to the same path.
15
15
  */
16
16
 
17
- const { defaultMetricsExporterToNone } = require('./otel-defaults');
18
- defaultMetricsExporterToNone();
17
+ const { nodeSdkDefaultTelemetryOptions } = require('./otel-defaults');
18
+ const nodeSdkTelemetryOptions = nodeSdkDefaultTelemetryOptions();
19
19
 
20
20
  const { diag, DiagConsoleLogger, DiagLogLevel, context, trace } = require('@opentelemetry/api');
21
21
  const { NodeSDK } = require('@opentelemetry/sdk-node');
@@ -654,6 +654,7 @@ process.on('unhandledRejection', (reason) => {
654
654
  // -------- SDK --------
655
655
  const traceExporter = new OTLPTraceExporter({ url: tracesUrl, headers });
656
656
  const sdk = new NodeSDK({
657
+ ...nodeSdkTelemetryOptions,
657
658
  traceExporter,
658
659
  instrumentations: [
659
660
  httpInstrumentation,