securenow 5.2.0 → 5.2.1
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/CONSUMING-APPS-GUIDE.md +17 -17
- package/README.md +7 -7
- package/cli.js +6 -6
- package/console-instrumentation.js +2 -2
- package/docs/ARCHITECTURE.md +3 -3
- package/docs/AUTO-BODY-CAPTURE.md +1 -1
- package/docs/AUTO-SETUP-SUMMARY.md +2 -2
- package/docs/AUTO-SETUP.md +4 -4
- package/docs/AUTOMATIC-IP-CAPTURE.md +5 -5
- package/docs/BODY-CAPTURE-FIX.md +1 -1
- package/docs/BODY-CAPTURE-QUICKSTART.md +2 -2
- package/docs/CHANGELOG-NEXTJS.md +1 -1
- package/docs/COMPLETION-REPORT.md +5 -5
- package/docs/CUSTOMER-GUIDE.md +16 -16
- package/docs/EASIEST-SETUP.md +5 -5
- package/docs/EXPRESS-BODY-CAPTURE.md +10 -10
- package/docs/IMPLEMENTATION-SUMMARY.md +10 -10
- package/docs/LOGGING-GUIDE.md +27 -27
- package/docs/LOGGING-QUICKSTART.md +13 -13
- package/docs/NEXTJS-BODY-CAPTURE.md +2 -2
- package/docs/NEXTJS-GUIDE.md +14 -14
- package/docs/NEXTJS-QUICKSTART.md +1 -1
- package/docs/NEXTJS-WRAPPER-APPROACH.md +1 -1
- package/docs/QUICKSTART-BODY-CAPTURE.md +2 -2
- package/docs/REDACTION-EXAMPLES.md +1 -1
- package/docs/REQUEST-BODY-CAPTURE.md +4 -4
- package/docs/SOLUTION-SUMMARY.md +4 -4
- package/docs/VERCEL-OTEL-MIGRATION.md +3 -3
- package/examples/README.md +6 -6
- package/examples/instrumentation-with-auto-capture.ts +1 -1
- package/examples/nextjs-env-example.txt +2 -2
- package/examples/nextjs-instrumentation.js +1 -1
- package/examples/nextjs-instrumentation.ts +1 -1
- package/examples/nextjs-with-logging-example.md +6 -6
- package/examples/nextjs-with-options.ts +1 -1
- package/examples/test-nextjs-setup.js +1 -1
- package/nextjs.d.ts +1 -1
- package/nextjs.js +1 -1
- package/package.json +2 -3
- package/postinstall.js +6 -6
- package/register.d.ts +1 -1
- package/tracing.d.ts +1 -1
package/CONSUMING-APPS-GUIDE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# How to Use SecureNow Logging in Your App
|
|
2
2
|
|
|
3
|
-
This guide is for developers who want to add the `securenow` package to their applications to enable logging to
|
|
3
|
+
This guide is for developers who want to add the `securenow` package to their applications to enable logging to SecureNow or any OTLP-compatible backend.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -25,11 +25,11 @@ SECURENOW_LOGGING_ENABLED=1
|
|
|
25
25
|
# Required: Your app name
|
|
26
26
|
SECURENOW_APPID=my-app-name
|
|
27
27
|
|
|
28
|
-
# Required: Your
|
|
29
|
-
SECURENOW_INSTANCE=http://your-
|
|
28
|
+
# Required: Your OTLP endpoint
|
|
29
|
+
SECURENOW_INSTANCE=http://your-otlp-collector:4318
|
|
30
30
|
|
|
31
|
-
# For
|
|
32
|
-
# OTEL_EXPORTER_OTLP_HEADERS="
|
|
31
|
+
# For managed OTLP / authentication (optional):
|
|
32
|
+
# OTEL_EXPORTER_OTLP_HEADERS="x-api-key=your-key"
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
---
|
|
@@ -40,7 +40,7 @@ You have **three options** to integrate logging:
|
|
|
40
40
|
|
|
41
41
|
#### **Option A: Automatic Console Instrumentation** (Recommended - Easiest)
|
|
42
42
|
|
|
43
|
-
This automatically captures all `console.log()`, `console.info()`, `console.warn()`, and `console.error()` calls and sends them to
|
|
43
|
+
This automatically captures all `console.log()`, `console.info()`, `console.warn()`, and `console.error()` calls and sends them to your configured OTLP backend (for example SecureNow).
|
|
44
44
|
|
|
45
45
|
**Add to your main application file:**
|
|
46
46
|
|
|
@@ -49,7 +49,7 @@ This automatically captures all `console.log()`, `console.info()`, `console.warn
|
|
|
49
49
|
require('securenow/register');
|
|
50
50
|
require('securenow/console-instrumentation');
|
|
51
51
|
|
|
52
|
-
// Now use console normally - all logs go to
|
|
52
|
+
// Now use console normally - all logs go to your OTLP backend!
|
|
53
53
|
console.log('Application started');
|
|
54
54
|
console.error('An error occurred', { userId: 123, details: 'Something went wrong' });
|
|
55
55
|
console.warn('Warning message');
|
|
@@ -268,16 +268,16 @@ bootstrap();
|
|
|
268
268
|
After starting your app, you should see:
|
|
269
269
|
|
|
270
270
|
```
|
|
271
|
-
[securenow] OTel SDK started → http://your-
|
|
272
|
-
[securenow] 📋 Logging: ENABLED → http://your-
|
|
271
|
+
[securenow] OTel SDK started → http://your-otlp-collector:4318/v1/traces
|
|
272
|
+
[securenow] 📋 Logging: ENABLED → http://your-otlp-collector:4318/v1/logs
|
|
273
273
|
[securenow] Console instrumentation installed
|
|
274
274
|
```
|
|
275
275
|
|
|
276
276
|
---
|
|
277
277
|
|
|
278
|
-
## View Logs in
|
|
278
|
+
## View Logs in SecureNow
|
|
279
279
|
|
|
280
|
-
1. Open your
|
|
280
|
+
1. Open your SecureNow dashboard
|
|
281
281
|
2. Go to **Logs** section
|
|
282
282
|
3. Filter by `service.name = my-app-name`
|
|
283
283
|
4. See all your logs with:
|
|
@@ -300,12 +300,12 @@ echo $SECURENOW_LOGGING_ENABLED # Should output: 1
|
|
|
300
300
|
**Check 2:** Verify endpoint is correct
|
|
301
301
|
|
|
302
302
|
```bash
|
|
303
|
-
# Self-hosted
|
|
303
|
+
# Self-hosted OTLP collector
|
|
304
304
|
export SECURENOW_INSTANCE=http://localhost:4318
|
|
305
305
|
|
|
306
|
-
#
|
|
307
|
-
export SECURENOW_INSTANCE=https://ingest.<region>.
|
|
308
|
-
export OTEL_EXPORTER_OTLP_HEADERS="
|
|
306
|
+
# Managed OTLP (example)
|
|
307
|
+
export SECURENOW_INSTANCE=https://ingest.<region>.securenow.ai:443
|
|
308
|
+
export OTEL_EXPORTER_OTLP_HEADERS="x-api-key=<your-key>"
|
|
309
309
|
```
|
|
310
310
|
|
|
311
311
|
**Check 3:** Enable debug logging
|
|
@@ -360,7 +360,7 @@ SECURENOW_INSTANCE=http://localhost:4318 # OTLP endpoint
|
|
|
360
360
|
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=... # Override logs endpoint
|
|
361
361
|
|
|
362
362
|
# Authentication
|
|
363
|
-
OTEL_EXPORTER_OTLP_HEADERS="
|
|
363
|
+
OTEL_EXPORTER_OTLP_HEADERS="x-api-key=KEY"
|
|
364
364
|
|
|
365
365
|
# Service Info
|
|
366
366
|
SECURENOW_APPID=my-app # Your app name
|
|
@@ -412,4 +412,4 @@ OTEL_LOG_LEVEL=debug # Enable debug output
|
|
|
412
412
|
|
|
413
413
|
---
|
|
414
414
|
|
|
415
|
-
**That's it!** Your app is now sending logs to
|
|
415
|
+
**That's it!** Your app is now sending logs to your OTLP backend (for example SecureNow). 🎉
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# SecureNow
|
|
2
2
|
|
|
3
|
-
OpenTelemetry instrumentation for Node.js and Next.js applications - send **traces and logs** to
|
|
3
|
+
OpenTelemetry instrumentation for Node.js and Next.js applications - send **traces and logs** to any OTLP-compatible backend (including SecureNow).
|
|
4
4
|
|
|
5
5
|
**Official npm package:** [securenow](http://securenow.ai/)
|
|
6
6
|
|
|
@@ -28,7 +28,7 @@ Then configure your `.env.local`:
|
|
|
28
28
|
|
|
29
29
|
```bash
|
|
30
30
|
SECURENOW_APPID=my-nextjs-app
|
|
31
|
-
SECURENOW_INSTANCE=http://your-
|
|
31
|
+
SECURENOW_INSTANCE=http://your-otlp-collector:4318
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
**Alternative:** Use the CLI command
|
|
@@ -50,7 +50,7 @@ npm install securenow
|
|
|
50
50
|
|
|
51
51
|
# 2. Set environment variables
|
|
52
52
|
export SECURENOW_APPID=my-app
|
|
53
|
-
export SECURENOW_INSTANCE=http://your-
|
|
53
|
+
export SECURENOW_INSTANCE=http://your-otlp-collector:4318
|
|
54
54
|
|
|
55
55
|
# 3. Run with preload
|
|
56
56
|
NODE_OPTIONS="-r securenow/register" node app.js
|
|
@@ -66,13 +66,13 @@ npm install securenow
|
|
|
66
66
|
|
|
67
67
|
# 2. Set environment variables
|
|
68
68
|
export SECURENOW_APPID=my-app
|
|
69
|
-
export SECURENOW_INSTANCE=http://your-
|
|
69
|
+
export SECURENOW_INSTANCE=http://your-otlp-collector:4318
|
|
70
70
|
export SECURENOW_LOGGING_ENABLED=1
|
|
71
71
|
|
|
72
72
|
# 3. Run with preload (adds logging)
|
|
73
73
|
NODE_OPTIONS="-r securenow/register -r securenow/console-instrumentation" node app.js
|
|
74
74
|
|
|
75
|
-
# Now all console.log/info/warn/error automatically go to
|
|
75
|
+
# Now all console.log/info/warn/error automatically go to your OTLP backend (for example SecureNow)!
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
---
|
|
@@ -97,9 +97,9 @@ pnpm add securenow
|
|
|
97
97
|
# Required: Your application identifier
|
|
98
98
|
SECURENOW_APPID=my-app-name
|
|
99
99
|
|
|
100
|
-
# Optional: Your
|
|
100
|
+
# Optional: Your OTLP collector endpoint
|
|
101
101
|
# Default: https://freetrial.securenow.ai:4318
|
|
102
|
-
SECURENOW_INSTANCE=http://your-
|
|
102
|
+
SECURENOW_INSTANCE=http://your-otlp-collector:4318
|
|
103
103
|
|
|
104
104
|
# Optional: Enable Logging
|
|
105
105
|
SECURENOW_LOGGING_ENABLED=1 # Enable automatic log collection
|
package/cli.js
CHANGED
|
@@ -31,7 +31,7 @@ export function register() {
|
|
|
31
31
|
* SECURENOW_APPID=my-nextjs-app
|
|
32
32
|
*
|
|
33
33
|
* Optional:
|
|
34
|
-
* SECURENOW_INSTANCE=http://your-
|
|
34
|
+
* SECURENOW_INSTANCE=http://your-otlp-backend:4318
|
|
35
35
|
* OTEL_EXPORTER_OTLP_HEADERS="x-api-key=your-key"
|
|
36
36
|
* OTEL_LOG_LEVEL=info
|
|
37
37
|
*/
|
|
@@ -49,7 +49,7 @@ export function register() {
|
|
|
49
49
|
* SECURENOW_APPID=my-nextjs-app
|
|
50
50
|
*
|
|
51
51
|
* Optional:
|
|
52
|
-
* SECURENOW_INSTANCE=http://your-
|
|
52
|
+
* SECURENOW_INSTANCE=http://your-otlp-backend:4318
|
|
53
53
|
* OTEL_EXPORTER_OTLP_HEADERS="x-api-key=your-key"
|
|
54
54
|
* OTEL_LOG_LEVEL=info
|
|
55
55
|
*/
|
|
@@ -58,9 +58,9 @@ export function register() {
|
|
|
58
58
|
# Required: Your application identifier
|
|
59
59
|
SECURENOW_APPID=my-nextjs-app
|
|
60
60
|
|
|
61
|
-
# Optional: Your
|
|
61
|
+
# Optional: Your OTLP-compatible backend / collector endpoint
|
|
62
62
|
# Default: https://freetrial.securenow.ai:4318
|
|
63
|
-
SECURENOW_INSTANCE=http://your-
|
|
63
|
+
SECURENOW_INSTANCE=http://your-otlp-backend:4318
|
|
64
64
|
|
|
65
65
|
# Optional: API key or authentication headers
|
|
66
66
|
# OTEL_EXPORTER_OTLP_HEADERS="x-api-key=your-api-key-here"
|
|
@@ -142,11 +142,11 @@ function initCommand(args) {
|
|
|
142
142
|
console.log('│ │');
|
|
143
143
|
console.log('│ 1. Edit .env.local and configure: │');
|
|
144
144
|
console.log('│ SECURENOW_APPID=your-app-name │');
|
|
145
|
-
console.log('│ SECURENOW_INSTANCE=http://
|
|
145
|
+
console.log('│ SECURENOW_INSTANCE=http://your-otlp-backend:4318 │');
|
|
146
146
|
console.log('│ │');
|
|
147
147
|
console.log('│ 2. Start your Next.js app: npm run dev │');
|
|
148
148
|
console.log('│ │');
|
|
149
|
-
console.log('│ 3. Check
|
|
149
|
+
console.log('│ 3. Check SecureNow dashboard for traces! │');
|
|
150
150
|
console.log('│ │');
|
|
151
151
|
console.log('│ 📚 Documentation: │');
|
|
152
152
|
console.log('│ node_modules/securenow/NEXTJS-GUIDE.md │');
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Console instrumentation helper for securenow
|
|
5
5
|
*
|
|
6
6
|
* This module wraps the default console methods (log, info, warn, error, debug)
|
|
7
|
-
* to automatically send logs to OpenTelemetry/
|
|
7
|
+
* to automatically send logs to OpenTelemetry / any OTLP-compatible backend.
|
|
8
8
|
*
|
|
9
9
|
* Usage:
|
|
10
10
|
* 1. Enable logging: SECURENOW_LOGGING_ENABLED=1
|
|
@@ -122,7 +122,7 @@ console.debug = function (...args) {
|
|
|
122
122
|
originalConsole.debug.apply(console, args);
|
|
123
123
|
};
|
|
124
124
|
|
|
125
|
-
console.log('[securenow] Console instrumentation installed - all console logs will be sent to
|
|
125
|
+
console.log('[securenow] Console instrumentation installed - all console logs will be sent to any OTLP-compatible backend');
|
|
126
126
|
|
|
127
127
|
module.exports = {
|
|
128
128
|
originalConsole,
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -36,7 +36,7 @@ SecureNow provides seamless OpenTelemetry instrumentation for Node.js and Next.j
|
|
|
36
36
|
│
|
|
37
37
|
▼
|
|
38
38
|
┌──────────────────────────────────┐
|
|
39
|
-
│
|
|
39
|
+
│ SecureNow / OpenTelemetry │
|
|
40
40
|
│ Collector │
|
|
41
41
|
└──────────────────────────────────┘
|
|
42
42
|
```
|
|
@@ -198,7 +198,7 @@ Your Application
|
|
|
198
198
|
│
|
|
199
199
|
▼
|
|
200
200
|
┌─────────────────┐
|
|
201
|
-
│
|
|
201
|
+
│ SecureNow / │
|
|
202
202
|
│ OTLP Collector │
|
|
203
203
|
└─────────────────┘
|
|
204
204
|
```
|
|
@@ -249,7 +249,7 @@ Every span includes these resource attributes:
|
|
|
249
249
|
6. Batch sent to collector via HTTP
|
|
250
250
|
│
|
|
251
251
|
▼
|
|
252
|
-
7. Visible in
|
|
252
|
+
7. Visible in SecureNow UI
|
|
253
253
|
```
|
|
254
254
|
|
|
255
255
|
---
|
|
@@ -40,10 +40,10 @@ Would you like to automatically create instrumentation file? (Y/n) Y
|
|
|
40
40
|
│ │
|
|
41
41
|
│ 1. Edit .env.local and set: │
|
|
42
42
|
│ SECURENOW_APPID=your-app-name │
|
|
43
|
-
│ SECURENOW_INSTANCE=http://
|
|
43
|
+
│ SECURENOW_INSTANCE=http://otel-collector:4318 │
|
|
44
44
|
│ │
|
|
45
45
|
│ 2. Run your app: npm run dev │
|
|
46
|
-
│ 3. Check
|
|
46
|
+
│ 3. Check SecureNow for traces! │
|
|
47
47
|
└─────────────────────────────────────────────────┘
|
|
48
48
|
```
|
|
49
49
|
|
package/docs/AUTO-SETUP.md
CHANGED
|
@@ -38,11 +38,11 @@ Would you like to automatically create instrumentation file? (Y/n) Y
|
|
|
38
38
|
│ │
|
|
39
39
|
│ 1. Edit .env.local and set: │
|
|
40
40
|
│ SECURENOW_APPID=your-app-name │
|
|
41
|
-
│ SECURENOW_INSTANCE=http://
|
|
41
|
+
│ SECURENOW_INSTANCE=http://otel-collector:4318 │
|
|
42
42
|
│ │
|
|
43
43
|
│ 2. Run your app: npm run dev │
|
|
44
44
|
│ │
|
|
45
|
-
│ 3. Check
|
|
45
|
+
│ 3. Check SecureNow for traces! │
|
|
46
46
|
└─────────────────────────────────────────────────┘
|
|
47
47
|
```
|
|
48
48
|
|
|
@@ -93,7 +93,7 @@ $ npx securenow init
|
|
|
93
93
|
│ Next steps: │
|
|
94
94
|
│ 1. Edit .env.local and configure │
|
|
95
95
|
│ 2. Start your app: npm run dev │
|
|
96
|
-
│ 3. Check
|
|
96
|
+
│ 3. Check SecureNow dashboard for traces! │
|
|
97
97
|
└─────────────────────────────────────────────────┘
|
|
98
98
|
```
|
|
99
99
|
|
|
@@ -115,7 +115,7 @@ export function register() {
|
|
|
115
115
|
```bash
|
|
116
116
|
# .env.local
|
|
117
117
|
SECURENOW_APPID=my-nextjs-app
|
|
118
|
-
SECURENOW_INSTANCE=http://your-
|
|
118
|
+
SECURENOW_INSTANCE=http://your-otlp-backend:4318
|
|
119
119
|
```
|
|
120
120
|
|
|
121
121
|
---
|
|
@@ -50,9 +50,9 @@ That's it! All request metadata is automatically captured.
|
|
|
50
50
|
|
|
51
51
|
---
|
|
52
52
|
|
|
53
|
-
## 📈 View in
|
|
53
|
+
## 📈 View in SecureNow
|
|
54
54
|
|
|
55
|
-
In your
|
|
55
|
+
In your SecureNow dashboard, you'll see these attributes on every span:
|
|
56
56
|
|
|
57
57
|
```json
|
|
58
58
|
{
|
|
@@ -160,7 +160,7 @@ export function register() {
|
|
|
160
160
|
- Consider anonymizing IPs in some regions
|
|
161
161
|
|
|
162
162
|
2. **Data Retention**
|
|
163
|
-
- Configure
|
|
163
|
+
- Configure SecureNow retention policies
|
|
164
164
|
- Consider shorter retention for IP data
|
|
165
165
|
|
|
166
166
|
3. **Anonymization Option**
|
|
@@ -281,7 +281,7 @@ LIMIT 10
|
|
|
281
281
|
1. **HttpInstrumentation** intercepts incoming HTTP requests
|
|
282
282
|
2. **requestHook** extracts headers and metadata
|
|
283
283
|
3. **Attributes** are added to the active span
|
|
284
|
-
4. **Data flows** to
|
|
284
|
+
4. **Data flows** to SecureNow with the trace
|
|
285
285
|
|
|
286
286
|
### Headers Priority
|
|
287
287
|
|
|
@@ -352,7 +352,7 @@ SecureNow automatically captures:
|
|
|
352
352
|
|
|
353
353
|
**Zero configuration required** - it just works!
|
|
354
354
|
|
|
355
|
-
View everything in
|
|
355
|
+
View everything in SecureNow for powerful analytics and debugging.
|
|
356
356
|
|
|
357
357
|
|
|
358
358
|
|
package/docs/BODY-CAPTURE-FIX.md
CHANGED
|
@@ -62,7 +62,7 @@ SECURENOW_SENSITIVE_FIELDS=email,phone,address
|
|
|
62
62
|
|
|
63
63
|
---
|
|
64
64
|
|
|
65
|
-
## View in
|
|
65
|
+
## View in SecureNow
|
|
66
66
|
|
|
67
67
|
Query for captured bodies:
|
|
68
68
|
```
|
|
@@ -125,7 +125,7 @@ app.post('/api/login', (req, res) => {
|
|
|
125
125
|
|
|
126
126
|
**Best practices:**
|
|
127
127
|
- Add relevant fields to `SECURENOW_SENSITIVE_FIELDS`
|
|
128
|
-
- Set appropriate retention in
|
|
128
|
+
- Set appropriate retention in SecureNow
|
|
129
129
|
- Document in privacy policy
|
|
130
130
|
- Consider GDPR/CCPA requirements
|
|
131
131
|
|
package/docs/CHANGELOG-NEXTJS.md
CHANGED
|
@@ -151,7 +151,7 @@ NODE_OPTIONS="-r securenow/register" node app.js
|
|
|
151
151
|
### 🙏 Credits
|
|
152
152
|
- Built on OpenTelemetry
|
|
153
153
|
- Inspired by Vercel's `@vercel/otel`
|
|
154
|
-
- Compatible with
|
|
154
|
+
- Compatible with SecureNow and all OTLP collectors
|
|
155
155
|
|
|
156
156
|
---
|
|
157
157
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## ✅ Mission Accomplished!
|
|
4
4
|
|
|
5
|
-
Your SecureNow package now has **seamless Next.js integration** that makes it incredibly easy for Next.js developers to add observability with
|
|
5
|
+
Your SecureNow package now has **seamless Next.js integration** that makes it incredibly easy for Next.js developers to add observability with SecureNow.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -119,7 +119,7 @@ export function register() { registerSecureNow(); }
|
|
|
119
119
|
|
|
120
120
|
**Environment Variables:**
|
|
121
121
|
- `SECURENOW_APPID` - Service name
|
|
122
|
-
- `SECURENOW_INSTANCE` -
|
|
122
|
+
- `SECURENOW_INSTANCE` - OTLP / SecureNow endpoint
|
|
123
123
|
- `SECURENOW_NO_UUID` - Disable UUID suffix
|
|
124
124
|
- `OTEL_LOG_LEVEL` - Logging level
|
|
125
125
|
- `SECURENOW_DISABLE_INSTRUMENTATIONS` - Disable specific libs
|
|
@@ -129,7 +129,7 @@ export function register() { registerSecureNow(); }
|
|
|
129
129
|
```typescript
|
|
130
130
|
registerSecureNow({
|
|
131
131
|
serviceName: 'my-app',
|
|
132
|
-
endpoint: 'http://
|
|
132
|
+
endpoint: 'http://otel-collector:4318',
|
|
133
133
|
noUuid: false,
|
|
134
134
|
headers: { 'x-api-key': '...' },
|
|
135
135
|
disableInstrumentations: ['fs'],
|
|
@@ -206,9 +206,9 @@ Automatically detects and includes:
|
|
|
206
206
|
- **Lower support burden** with comprehensive docs
|
|
207
207
|
- **Faster adoption** with clear examples
|
|
208
208
|
|
|
209
|
-
### For
|
|
209
|
+
### For the SecureNow community
|
|
210
210
|
- **Easier onboarding** of Next.js apps
|
|
211
|
-
- **More users** adopting
|
|
211
|
+
- **More users** adopting SecureNow
|
|
212
212
|
- **Better traces** with auto-instrumentation
|
|
213
213
|
- **Reference implementation** for others
|
|
214
214
|
|
package/docs/CUSTOMER-GUIDE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 🚀 Add Observability to Your Next.js App in 2 Minutes
|
|
2
2
|
|
|
3
|
-
**Send traces to
|
|
3
|
+
**Send traces to SecureNow with just 1-2 steps. No webpack warnings!**
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -51,7 +51,7 @@ Create or update `.env.local`:
|
|
|
51
51
|
```bash
|
|
52
52
|
# Just update these two values:
|
|
53
53
|
SECURENOW_APPID=my-nextjs-app # Your app name
|
|
54
|
-
SECURENOW_INSTANCE=http://your-
|
|
54
|
+
SECURENOW_INSTANCE=http://your-otlp-backend:4318 # Your OTLP / SecureNow URL
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
---
|
|
@@ -83,7 +83,7 @@ Then create `.env.local`:
|
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
85
|
SECURENOW_APPID=my-nextjs-app
|
|
86
|
-
SECURENOW_INSTANCE=http://your-
|
|
86
|
+
SECURENOW_INSTANCE=http://your-otlp-backend:4318
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
---
|
|
@@ -104,7 +104,7 @@ You should see:
|
|
|
104
104
|
[securenow] ✅ OpenTelemetry started for Next.js
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
Open your **
|
|
107
|
+
Open your **SecureNow dashboard** and you'll see traces immediately!
|
|
108
108
|
|
|
109
109
|
---
|
|
110
110
|
|
|
@@ -169,7 +169,7 @@ No additional code needed!
|
|
|
169
169
|
|
|
170
170
|
## ⚙️ Optional: Add Authentication
|
|
171
171
|
|
|
172
|
-
If your
|
|
172
|
+
If your OTLP backend requires an API key:
|
|
173
173
|
|
|
174
174
|
```bash
|
|
175
175
|
# Add to .env.local
|
|
@@ -188,9 +188,9 @@ import { registerSecureNow } from 'securenow/nextjs';
|
|
|
188
188
|
export function register() {
|
|
189
189
|
registerSecureNow({
|
|
190
190
|
serviceName: 'my-app',
|
|
191
|
-
endpoint: 'http://
|
|
191
|
+
endpoint: 'http://otel-collector:4318',
|
|
192
192
|
headers: {
|
|
193
|
-
'x-api-key': process.env.
|
|
193
|
+
'x-api-key': process.env.SECURENOW_API_KEY || '',
|
|
194
194
|
},
|
|
195
195
|
disableInstrumentations: ['fs'], // Optional: disable specific instrumentations
|
|
196
196
|
});
|
|
@@ -221,9 +221,9 @@ OTEL_LOG_LEVEL=debug
|
|
|
221
221
|
SECURENOW_TEST_SPAN=1
|
|
222
222
|
```
|
|
223
223
|
|
|
224
|
-
**4. Verify
|
|
224
|
+
**4. Verify your OTLP endpoint is accessible**
|
|
225
225
|
```bash
|
|
226
|
-
curl http://your-
|
|
226
|
+
curl http://your-otlp-backend:4318/v1/traces
|
|
227
227
|
```
|
|
228
228
|
|
|
229
229
|
---
|
|
@@ -256,10 +256,10 @@ module.exports = nextConfig;
|
|
|
256
256
|
1. Go to your Vercel project settings
|
|
257
257
|
2. Add environment variables:
|
|
258
258
|
- `SECURENOW_APPID=my-nextjs-app`
|
|
259
|
-
- `SECURENOW_INSTANCE=http://your-
|
|
259
|
+
- `SECURENOW_INSTANCE=http://your-otlp-backend:4318`
|
|
260
260
|
3. Redeploy
|
|
261
261
|
|
|
262
|
-
**Done!** Traces will appear in
|
|
262
|
+
**Done!** Traces will appear in SecureNow.
|
|
263
263
|
|
|
264
264
|
### Docker
|
|
265
265
|
|
|
@@ -274,7 +274,7 @@ COPY . .
|
|
|
274
274
|
RUN npm run build
|
|
275
275
|
|
|
276
276
|
ENV SECURENOW_APPID=my-nextjs-app
|
|
277
|
-
ENV SECURENOW_INSTANCE=http://
|
|
277
|
+
ENV SECURENOW_INSTANCE=http://otel-collector:4318
|
|
278
278
|
|
|
279
279
|
EXPOSE 3000
|
|
280
280
|
CMD ["npm", "start"]
|
|
@@ -284,7 +284,7 @@ CMD ["npm", "start"]
|
|
|
284
284
|
|
|
285
285
|
```bash
|
|
286
286
|
export SECURENOW_APPID=my-nextjs-app
|
|
287
|
-
export SECURENOW_INSTANCE=http://your-
|
|
287
|
+
export SECURENOW_INSTANCE=http://your-otlp-backend:4318
|
|
288
288
|
npm start
|
|
289
289
|
```
|
|
290
290
|
|
|
@@ -295,7 +295,7 @@ npm start
|
|
|
295
295
|
```bash
|
|
296
296
|
# ===== REQUIRED =====
|
|
297
297
|
SECURENOW_APPID=my-app-name # Your app identifier
|
|
298
|
-
SECURENOW_INSTANCE=http://host:4318 #
|
|
298
|
+
SECURENOW_INSTANCE=http://host:4318 # OTLP / SecureNow endpoint
|
|
299
299
|
|
|
300
300
|
# ===== OPTIONAL =====
|
|
301
301
|
OTEL_EXPORTER_OTLP_HEADERS="key=val" # API keys/headers
|
|
@@ -336,7 +336,7 @@ SECURENOW_TEST_SPAN=1 # Test span on startup
|
|
|
336
336
|
|
|
337
337
|
- **Documentation:** [Full guides](./NEXTJS-GUIDE.md)
|
|
338
338
|
- **Examples:** See `examples/` folder
|
|
339
|
-
- **
|
|
339
|
+
- **SecureNow:** [securenow.ai](https://securenow.ai/)
|
|
340
340
|
|
|
341
341
|
---
|
|
342
342
|
|
|
@@ -356,7 +356,7 @@ SECURENOW_TEST_SPAN=1 # Test span on startup
|
|
|
356
356
|
|
|
357
357
|
<div align="center">
|
|
358
358
|
|
|
359
|
-
**Made with ❤️ for Next.js and
|
|
359
|
+
**Made with ❤️ for Next.js and SecureNow**
|
|
360
360
|
|
|
361
361
|
[Website](http://securenow.ai/) • [NPM](https://www.npmjs.com/package/securenow) • [Documentation](./NEXTJS-GUIDE.md)
|
|
362
362
|
|
package/docs/EASIEST-SETUP.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
```bash
|
|
14
14
|
# .env.local
|
|
15
15
|
SECURENOW_APPID=my-nextjs-app
|
|
16
|
-
SECURENOW_INSTANCE=http://your-
|
|
16
|
+
SECURENOW_INSTANCE=http://your-otlp-backend:4318
|
|
17
17
|
SECURENOW_CAPTURE_BODY=1
|
|
18
18
|
```
|
|
19
19
|
|
|
@@ -61,7 +61,7 @@ export async function POST(request: Request) {
|
|
|
61
61
|
"password": "secret123"
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
// Captured in
|
|
64
|
+
// Captured in SecureNow (password redacted):
|
|
65
65
|
{
|
|
66
66
|
"email": "user@example.com",
|
|
67
67
|
"password": "[REDACTED]"
|
|
@@ -110,7 +110,7 @@ export function register() {
|
|
|
110
110
|
```bash
|
|
111
111
|
# Required
|
|
112
112
|
SECURENOW_APPID=my-nextjs-app
|
|
113
|
-
SECURENOW_INSTANCE=http://
|
|
113
|
+
SECURENOW_INSTANCE=http://otel-collector:4318
|
|
114
114
|
|
|
115
115
|
# Enable body capture
|
|
116
116
|
SECURENOW_CAPTURE_BODY=1
|
|
@@ -248,7 +248,7 @@ export function register() {
|
|
|
248
248
|
```bash
|
|
249
249
|
# .env.local
|
|
250
250
|
SECURENOW_APPID=my-app
|
|
251
|
-
SECURENOW_INSTANCE=http://
|
|
251
|
+
SECURENOW_INSTANCE=http://otel-collector:4318
|
|
252
252
|
SECURENOW_CAPTURE_BODY=1
|
|
253
253
|
```
|
|
254
254
|
|
|
@@ -258,7 +258,7 @@ SECURENOW_CAPTURE_BODY=1
|
|
|
258
258
|
npm run dev
|
|
259
259
|
```
|
|
260
260
|
|
|
261
|
-
### 5. Check
|
|
261
|
+
### 5. Check SecureNow
|
|
262
262
|
|
|
263
263
|
**See traces with:**
|
|
264
264
|
- ✅ Request bodies (redacted)
|
|
@@ -55,7 +55,7 @@ Create `.env` or set in PM2 ecosystem file:
|
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
57
|
SECURENOW_APPID=my-express-api
|
|
58
|
-
SECURENOW_INSTANCE=http://your-
|
|
58
|
+
SECURENOW_INSTANCE=http://your-otlp-backend:4318
|
|
59
59
|
SECURENOW_CAPTURE_BODY=1
|
|
60
60
|
SECURENOW_MAX_BODY_SIZE=10240
|
|
61
61
|
```
|
|
@@ -227,7 +227,7 @@ module.exports = {
|
|
|
227
227
|
env: {
|
|
228
228
|
NODE_ENV: 'production',
|
|
229
229
|
SECURENOW_APPID: 'express-api',
|
|
230
|
-
SECURENOW_INSTANCE: 'http://
|
|
230
|
+
SECURENOW_INSTANCE: 'http://otel-collector:4318',
|
|
231
231
|
SECURENOW_CAPTURE_BODY: '1',
|
|
232
232
|
SECURENOW_NO_UUID: '1', // Same service.name
|
|
233
233
|
SECURENOW_STRICT: '1', // Fail if APPID missing
|
|
@@ -419,7 +419,7 @@ module.exports = {
|
|
|
419
419
|
NODE_ENV: 'production',
|
|
420
420
|
PORT: 3000,
|
|
421
421
|
SECURENOW_APPID: 'express-api',
|
|
422
|
-
SECURENOW_INSTANCE: 'http://
|
|
422
|
+
SECURENOW_INSTANCE: 'http://otel-collector.company.com:4318',
|
|
423
423
|
SECURENOW_CAPTURE_BODY: '1',
|
|
424
424
|
SECURENOW_MAX_BODY_SIZE: '10240',
|
|
425
425
|
SECURENOW_NO_UUID: '1',
|
|
@@ -451,7 +451,7 @@ module.exports = {
|
|
|
451
451
|
NODE_ENV: 'production',
|
|
452
452
|
PORT: 3000,
|
|
453
453
|
SECURENOW_APPID: 'express-api',
|
|
454
|
-
SECURENOW_INSTANCE: 'http://
|
|
454
|
+
SECURENOW_INSTANCE: 'http://otel-collector.company.com:4318',
|
|
455
455
|
SECURENOW_CAPTURE_BODY: '1',
|
|
456
456
|
SECURENOW_MAX_BODY_SIZE: '10240',
|
|
457
457
|
SECURENOW_NO_UUID: '1',
|
|
@@ -541,7 +541,7 @@ curl -X POST http://localhost:3000/api/login \
|
|
|
541
541
|
|
|
542
542
|
### Expected Trace Attributes
|
|
543
543
|
|
|
544
|
-
In your
|
|
544
|
+
In your SecureNow dashboard, you should see:
|
|
545
545
|
|
|
546
546
|
```json
|
|
547
547
|
{
|
|
@@ -612,14 +612,14 @@ app.post('/api/upload', (req, res) => {
|
|
|
612
612
|
|
|
613
613
|
- Add custom sensitive fields: `SECURENOW_SENSITIVE_FIELDS`
|
|
614
614
|
- Test with production-like data
|
|
615
|
-
- Review traces in
|
|
615
|
+
- Review traces in SecureNow
|
|
616
616
|
|
|
617
617
|
### 2. Body Size Limits
|
|
618
618
|
|
|
619
619
|
**Large bodies can cause:**
|
|
620
620
|
- Memory issues
|
|
621
621
|
- Performance degradation
|
|
622
|
-
- Storage costs in
|
|
622
|
+
- Storage costs in SecureNow
|
|
623
623
|
|
|
624
624
|
**Recommendation:**
|
|
625
625
|
- Keep `SECURENOW_MAX_BODY_SIZE` under 20KB
|
|
@@ -861,7 +861,7 @@ module.exports = {
|
|
|
861
861
|
NODE_ENV: 'production',
|
|
862
862
|
PORT: 3000,
|
|
863
863
|
SECURENOW_APPID: 'express-ts-api',
|
|
864
|
-
SECURENOW_INSTANCE: 'http://
|
|
864
|
+
SECURENOW_INSTANCE: 'http://otel-collector.company.com:4318',
|
|
865
865
|
SECURENOW_CAPTURE_BODY: '1',
|
|
866
866
|
SECURENOW_MAX_BODY_SIZE: '10240',
|
|
867
867
|
SECURENOW_NO_UUID: '1',
|
|
@@ -1001,7 +1001,7 @@ Currently not customizable. Default fields are comprehensive.
|
|
|
1001
1001
|
|
|
1002
1002
|
SecureNow uses OpenTelemetry standard, so it works with:
|
|
1003
1003
|
|
|
1004
|
-
- ✅
|
|
1004
|
+
- ✅ SecureNow (recommended)
|
|
1005
1005
|
- ✅ Jaeger
|
|
1006
1006
|
- ✅ Zipkin
|
|
1007
1007
|
- ✅ Any OTLP-compatible backend
|
|
@@ -1019,7 +1019,7 @@ If you encounter issues:
|
|
|
1019
1019
|
1. Check [Troubleshooting](#-troubleshooting) section
|
|
1020
1020
|
2. Enable debug logs: `OTEL_LOG_LEVEL=debug`
|
|
1021
1021
|
3. Check PM2 logs: `pm2 logs express-api`
|
|
1022
|
-
4. Review your
|
|
1022
|
+
4. Review your SecureNow dashboard for traces
|
|
1023
1023
|
|
|
1024
1024
|
---
|
|
1025
1025
|
|