securenow 3.0.2 → 3.0.3
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/package.json +1 -1
- package/tracing.js +5 -5
package/package.json
CHANGED
package/tracing.js
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
* securenow/tracing.js
|
|
5
5
|
* Preload with: NODE_OPTIONS="--require securenow/register" (or -r securenow/register via PM2)
|
|
6
6
|
* Env you can use:
|
|
7
|
-
* -
|
|
7
|
+
* - SECURENOW_INSTANCE=http://host:4318 # base OTLP/HTTP endpoint (defaults to http://46.62.173.237:4318)
|
|
8
8
|
* - OTEL_EXPORTER_OTLP_ENDPOINT=... # alt base (will be used if securenow_instance not set)
|
|
9
9
|
* - OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=... # full traces URL (overrides base)
|
|
10
10
|
* - OTEL_EXPORTER_OTLP_HEADERS="authorization=Bearer abc123,foo=bar"
|
|
11
11
|
* - OTEL_SERVICE_NAME=your-service # logical name (UUID suffix auto-appended)
|
|
12
|
-
* -
|
|
12
|
+
* - SECURENOW_APPID=your-appid # fallback logical name (UUID suffix auto-appended)
|
|
13
13
|
* - SECURENOW_NO_UUID=1 # disable UUID suffix
|
|
14
14
|
* - SECURENOW_DISABLE_INSTRUMENTATIONS="@opentelemetry/instrumentation-mongodb,@opentelemetry/instrumentation-redis"
|
|
15
15
|
* - OTEL_LOG_LEVEL=info|debug # OTel internal diagnostics
|
|
@@ -48,7 +48,7 @@ try {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
// ---------- Endpoint config (HTTP/4318) ----------
|
|
51
|
-
const endpointBase = (process.env.
|
|
51
|
+
const endpointBase = (process.env.SECURENOW_INSTANCE || process.env.OTEL_EXPORTER_OTLP_ENDPOINT || 'http://46.62.173.237:4318').replace(/\/$/, '');
|
|
52
52
|
const tracesUrl = (process.env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT || `${endpointBase}/v1/traces`);
|
|
53
53
|
|
|
54
54
|
// ---------- Headers parsing ----------
|
|
@@ -71,8 +71,8 @@ const headers = parseOtelHeaders(process.env.OTEL_EXPORTER_OTLP_HEADERS);
|
|
|
71
71
|
|
|
72
72
|
// ---------- Service name with UUID rules ----------
|
|
73
73
|
let serviceName;
|
|
74
|
-
if (process.env.
|
|
75
|
-
serviceName = process.env.
|
|
74
|
+
if (process.env.SECURENOW_APPID) {
|
|
75
|
+
serviceName = process.env.SECURENOW_APPID;
|
|
76
76
|
} else {
|
|
77
77
|
// default can also be unique to avoid collisions
|
|
78
78
|
serviceName = `securenow-free-${uuidv4()}`;
|