securenow 5.6.0 → 5.7.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/CONSUMING-APPS-GUIDE.md +411 -415
- package/NPM_README.md +1594 -1609
- package/README.md +72 -36
- package/cli/monitor.js +13 -1
- package/cli/run.js +133 -0
- package/cli.js +22 -1
- package/console-instrumentation.js +6 -1
- package/docs/ALL-FRAMEWORKS-QUICKSTART.md +1282 -455
- package/docs/EXPRESS-SETUP-GUIDE.md +719 -720
- package/docs/INDEX.md +14 -3
- package/docs/LOGGING-GUIDE.md +701 -708
- package/docs/LOGGING-QUICKSTART.md +234 -239
- package/docs/NUXT-GUIDE.md +166 -0
- package/nextjs-webpack-config.js +77 -0
- package/nextjs.js +19 -3
- package/nuxt-server-plugin.mjs +400 -0
- package/nuxt.d.ts +60 -0
- package/nuxt.mjs +75 -0
- package/package.json +21 -4
- package/register.js +39 -4
- package/tracing.js +15 -7
|
@@ -1,239 +1,234 @@
|
|
|
1
|
-
# SecureNow Logging - Quick Start
|
|
2
|
-
|
|
3
|
-
Get logging set up in your Node.js app in under 2 minutes!
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
#
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
console.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
[securenow]
|
|
68
|
-
[securenow]
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## 5. View Logs in SecureNow
|
|
74
|
-
|
|
75
|
-
1. Open your SecureNow dashboard
|
|
76
|
-
2. Go to **Logs** section
|
|
77
|
-
3. Filter by `service.name = my-app`
|
|
78
|
-
4. See all your logs with automatic trace correlation!
|
|
79
|
-
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
## Framework-Specific Examples
|
|
83
|
-
|
|
84
|
-
### Express.js
|
|
85
|
-
|
|
86
|
-
```javascript
|
|
87
|
-
// app.js
|
|
88
|
-
require('securenow/register');
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
require('
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
require('securenow/register');
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
---
|
|
236
|
-
|
|
237
|
-
**That's it!** 🎉 Your app is now sending logs to SecureNow.
|
|
238
|
-
|
|
239
|
-
Need help? Check the [full documentation](./LOGGING-GUIDE.md) or open an issue.
|
|
1
|
+
# SecureNow Logging - Quick Start
|
|
2
|
+
|
|
3
|
+
Get logging set up in your Node.js app in under 2 minutes!
|
|
4
|
+
|
|
5
|
+
**Since v5.6.0:** When `SECURENOW_LOGGING_ENABLED=1` is set, all `console.log` / `warn` / `error` / `info` / `debug` calls are automatically forwarded as OTLP log records. You only need `require('securenow/register')`—a separate `console-instrumentation` preload is no longer required.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install securenow
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 2. Configure Environment
|
|
18
|
+
|
|
19
|
+
Create `.env` file or export variables:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
SECURENOW_LOGGING_ENABLED=1
|
|
23
|
+
SECURENOW_APPID=my-app
|
|
24
|
+
SECURENOW_INSTANCE=http://your-otlp-backend:4318
|
|
25
|
+
|
|
26
|
+
# For SecureNow / hosted OTLP (example):
|
|
27
|
+
# SECURENOW_INSTANCE=https://freetrial.securenow.ai:4318
|
|
28
|
+
# OTEL_EXPORTER_OTLP_HEADERS="x-api-key=<your-key>"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 3. Add to Your App
|
|
34
|
+
|
|
35
|
+
**Option A: Automatic Console Logging (Easiest)**
|
|
36
|
+
|
|
37
|
+
Add this line at the top of your main file:
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
// app.js, index.js, server.js, or main.ts
|
|
41
|
+
require('securenow/register');
|
|
42
|
+
|
|
43
|
+
// That's it! Now use console normally
|
|
44
|
+
console.log('App started');
|
|
45
|
+
console.error('An error occurred', { userId: 123 });
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Option B: Use NODE_OPTIONS (No code changes)**
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
NODE_OPTIONS="-r securenow/register" node app.js
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 4. Run Your App
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
node app.js
|
|
60
|
+
# or
|
|
61
|
+
npm start
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
You should see:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
[securenow] OTel SDK started → http://your-otlp-backend:4318/v1/traces
|
|
68
|
+
[securenow] 📋 Logging: ENABLED → http://your-otlp-backend:4318/v1/logs
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 5. View Logs in SecureNow
|
|
74
|
+
|
|
75
|
+
1. Open your SecureNow dashboard
|
|
76
|
+
2. Go to **Logs** section
|
|
77
|
+
3. Filter by `service.name = my-app`
|
|
78
|
+
4. See all your logs with automatic trace correlation!
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Framework-Specific Examples
|
|
83
|
+
|
|
84
|
+
### Express.js
|
|
85
|
+
|
|
86
|
+
```javascript
|
|
87
|
+
// app.js
|
|
88
|
+
require('securenow/register');
|
|
89
|
+
|
|
90
|
+
const express = require('express');
|
|
91
|
+
const app = express();
|
|
92
|
+
|
|
93
|
+
app.get('/', (req, res) => {
|
|
94
|
+
console.log('Request received');
|
|
95
|
+
res.send('Hello World');
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
app.listen(3000);
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### Next.js
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
// instrumentation.ts (in project root)
|
|
105
|
+
export async function register() {
|
|
106
|
+
if (process.env.NEXT_RUNTIME === 'nodejs') {
|
|
107
|
+
process.env.SECURENOW_LOGGING_ENABLED = '1';
|
|
108
|
+
await import('securenow/register');
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# .env.local
|
|
115
|
+
SECURENOW_LOGGING_ENABLED=1
|
|
116
|
+
SECURENOW_APPID=my-nextjs-app
|
|
117
|
+
SECURENOW_INSTANCE=http://localhost:4318
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Fastify
|
|
121
|
+
|
|
122
|
+
```javascript
|
|
123
|
+
// server.js
|
|
124
|
+
require('securenow/register');
|
|
125
|
+
|
|
126
|
+
const fastify = require('fastify')();
|
|
127
|
+
|
|
128
|
+
fastify.get('/', async () => {
|
|
129
|
+
console.log('Route called');
|
|
130
|
+
return { hello: 'world' };
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
fastify.listen({ port: 3000 });
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### NestJS
|
|
137
|
+
|
|
138
|
+
```typescript
|
|
139
|
+
// main.ts
|
|
140
|
+
require('securenow/register');
|
|
141
|
+
|
|
142
|
+
import { NestFactory } from '@nestjs/core';
|
|
143
|
+
import { AppModule } from './app.module';
|
|
144
|
+
|
|
145
|
+
async function bootstrap() {
|
|
146
|
+
const app = await NestFactory.create(AppModule);
|
|
147
|
+
console.log('App starting');
|
|
148
|
+
await app.listen(3000);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
bootstrap();
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Troubleshooting
|
|
157
|
+
|
|
158
|
+
**Logs not appearing?**
|
|
159
|
+
|
|
160
|
+
1. Check `SECURENOW_LOGGING_ENABLED=1` is set
|
|
161
|
+
2. Verify your OTLP / SecureNow endpoint is correct
|
|
162
|
+
3. Enable debug: `OTEL_LOG_LEVEL=debug`
|
|
163
|
+
|
|
164
|
+
**Console logs not forwarding?**
|
|
165
|
+
|
|
166
|
+
Load `securenow/register` before other app code so logging hooks run first:
|
|
167
|
+
|
|
168
|
+
```javascript
|
|
169
|
+
// ✅ Correct
|
|
170
|
+
require('securenow/register'); // First
|
|
171
|
+
|
|
172
|
+
// ❌ Wrong
|
|
173
|
+
require('express');
|
|
174
|
+
require('securenow/register'); // Too late!
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## What Gets Logged?
|
|
180
|
+
|
|
181
|
+
All standard console methods:
|
|
182
|
+
|
|
183
|
+
- `console.log()` → INFO
|
|
184
|
+
- `console.info()` → INFO
|
|
185
|
+
- `console.warn()` → WARN
|
|
186
|
+
- `console.error()` → ERROR
|
|
187
|
+
- `console.debug()` → DEBUG
|
|
188
|
+
|
|
189
|
+
**Structured logging example:**
|
|
190
|
+
|
|
191
|
+
```javascript
|
|
192
|
+
console.log('User logged in', {
|
|
193
|
+
userId: 123,
|
|
194
|
+
email: 'user@example.com',
|
|
195
|
+
ip: '192.168.1.1'
|
|
196
|
+
});
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
This creates a log with attributes you can filter/search in SecureNow!
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Advanced Usage
|
|
204
|
+
|
|
205
|
+
**Direct Logger API:**
|
|
206
|
+
|
|
207
|
+
```javascript
|
|
208
|
+
const { getLogger } = require('securenow/tracing');
|
|
209
|
+
const logger = getLogger('my-module', '1.0.0');
|
|
210
|
+
|
|
211
|
+
logger.emit({
|
|
212
|
+
severityNumber: 9,
|
|
213
|
+
severityText: 'INFO',
|
|
214
|
+
body: 'Custom log message',
|
|
215
|
+
attributes: {
|
|
216
|
+
customField: 'value',
|
|
217
|
+
},
|
|
218
|
+
});
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Next Steps
|
|
224
|
+
|
|
225
|
+
- [Complete Logging Guide](./LOGGING-GUIDE.md) - All features and options
|
|
226
|
+
- [SecureNow](https://securenow.ai/)
|
|
227
|
+
- [Documentation](./INDEX.md)
|
|
228
|
+
- [Combine with Tracing](../README.md) - Full observability
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
**That's it!** 🎉 Your app is now sending logs to SecureNow.
|
|
233
|
+
|
|
234
|
+
Need help? Check the [full documentation](./LOGGING-GUIDE.md) or open an issue.
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# SecureNow — Nuxt 3 Setup Guide
|
|
2
|
+
|
|
3
|
+
## Quick Start (1 minute)
|
|
4
|
+
|
|
5
|
+
### 1. Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install securenow
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### 2. Add the module to `nuxt.config.ts`
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
export default defineNuxtConfig({
|
|
15
|
+
modules: ['securenow/nuxt'],
|
|
16
|
+
});
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### 3. Set environment variables
|
|
20
|
+
|
|
21
|
+
Create a `.env` file in your project root:
|
|
22
|
+
|
|
23
|
+
```env
|
|
24
|
+
SECURENOW_APPID=my-nuxt-app
|
|
25
|
+
SECURENOW_INSTANCE=https://freetrial.securenow.ai:4318
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### 4. Start your app
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
nuxt dev
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
You should see in the console:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
[securenow] Nuxt module loaded — server plugin registered
|
|
38
|
+
[securenow] 🚀 Nuxt OTel SDK started → https://freetrial.securenow.ai:4318/v1/traces
|
|
39
|
+
[securenow] service.name=my-nuxt-app instance.id=my-nuxt-app-...
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
That's it — all server-side requests are now traced.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Configuration
|
|
47
|
+
|
|
48
|
+
### Module options in `nuxt.config.ts`
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
export default defineNuxtConfig({
|
|
52
|
+
modules: ['securenow/nuxt'],
|
|
53
|
+
securenow: {
|
|
54
|
+
serviceName: 'my-nuxt-app', // overrides SECURENOW_APPID
|
|
55
|
+
endpoint: 'http://host:4318', // overrides SECURENOW_INSTANCE
|
|
56
|
+
noUuid: true, // single service.name (no UUID suffix)
|
|
57
|
+
captureBody: true, // capture POST/PUT/PATCH bodies
|
|
58
|
+
logging: true, // forward console.* as OTLP logs
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Environment variables
|
|
64
|
+
|
|
65
|
+
All standard SecureNow env vars are supported:
|
|
66
|
+
|
|
67
|
+
| Variable | Description | Default |
|
|
68
|
+
|----------|-------------|---------|
|
|
69
|
+
| `SECURENOW_APPID` | Service name | `nuxt-app-<uuid>` |
|
|
70
|
+
| `SECURENOW_INSTANCE` | OTLP base URL | `https://freetrial.securenow.ai:4318` |
|
|
71
|
+
| `SECURENOW_NO_UUID` | Don't append UUID to service name | `false` |
|
|
72
|
+
| `SECURENOW_LOGGING_ENABLED` | Forward console logs as OTLP | `false` |
|
|
73
|
+
| `SECURENOW_CAPTURE_BODY` | Capture request bodies | `false` |
|
|
74
|
+
| `SECURENOW_MAX_BODY_SIZE` | Max body size to capture (bytes) | `10240` |
|
|
75
|
+
| `SECURENOW_SENSITIVE_FIELDS` | Extra fields to redact (CSV) | _(built-in list)_ |
|
|
76
|
+
| `OTEL_EXPORTER_OTLP_ENDPOINT` | Alternative OTLP base URL | — |
|
|
77
|
+
| `OTEL_EXPORTER_OTLP_HEADERS` | OTLP headers (k=v,k2=v2) | — |
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## What gets traced
|
|
82
|
+
|
|
83
|
+
### Automatic (out of the box)
|
|
84
|
+
|
|
85
|
+
- All Nitro server handler requests (API routes, SSR pages, middleware)
|
|
86
|
+
- HTTP method, path, status code, duration
|
|
87
|
+
- Client IP address (with proxy-aware resolution)
|
|
88
|
+
- User-Agent, Referer, Origin, Host
|
|
89
|
+
- Security header presence (auth, cookies, CSRF)
|
|
90
|
+
- Request IDs and correlation headers
|
|
91
|
+
|
|
92
|
+
### With `captureBody: true`
|
|
93
|
+
|
|
94
|
+
- POST/PUT/PATCH request bodies (JSON, form-urlencoded, GraphQL)
|
|
95
|
+
- Sensitive fields auto-redacted (passwords, tokens, etc.)
|
|
96
|
+
- Bodies larger than `SECURENOW_MAX_BODY_SIZE` are skipped
|
|
97
|
+
|
|
98
|
+
### With `logging: true`
|
|
99
|
+
|
|
100
|
+
- All `console.log/info/warn/error/debug` calls forwarded as OTLP log records
|
|
101
|
+
- Logs correlated with active trace spans
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Comparison with Next.js integration
|
|
106
|
+
|
|
107
|
+
| Feature | Nuxt (`securenow/nuxt`) | Next.js (`securenow/nextjs`) |
|
|
108
|
+
|---------|-------------------------|------------------------------|
|
|
109
|
+
| Setup | Add to `modules` array | Create `instrumentation.ts` |
|
|
110
|
+
| Config | `nuxt.config.ts` | `.env.local` + `next.config.js` |
|
|
111
|
+
| Server tracing | Nitro hooks | HTTP instrumentation |
|
|
112
|
+
| Edge runtime | Not supported | Skipped gracefully |
|
|
113
|
+
| Vercel support | Via env vars | `@vercel/otel` integration |
|
|
114
|
+
| Body capture | HTTP instrumentation | Middleware + `Request.clone()` |
|
|
115
|
+
| Logging | Console patching | Console patching |
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Deployment
|
|
120
|
+
|
|
121
|
+
### Node.js server (PM2, Docker, etc.)
|
|
122
|
+
|
|
123
|
+
Works out of the box with `nuxt build && node .output/server/index.mjs`.
|
|
124
|
+
|
|
125
|
+
### Vercel / Netlify / Cloudflare
|
|
126
|
+
|
|
127
|
+
Set env vars in the platform dashboard:
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
SECURENOW_APPID=my-nuxt-app
|
|
131
|
+
SECURENOW_INSTANCE=https://your-otlp-backend:4318
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
> Note: On edge runtimes (Cloudflare Workers, Vercel Edge), some Node.js-specific
|
|
135
|
+
> instrumentations may not be available. Server-handler tracing via Nitro hooks
|
|
136
|
+
> still works.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Troubleshooting
|
|
141
|
+
|
|
142
|
+
### No traces appearing
|
|
143
|
+
|
|
144
|
+
1. Check that `SECURENOW_APPID` and `SECURENOW_INSTANCE` are set
|
|
145
|
+
2. Look for `[securenow] 🚀 Nuxt OTel SDK started` in the console
|
|
146
|
+
3. Verify the OTLP endpoint is reachable from your server
|
|
147
|
+
|
|
148
|
+
### Module not loading
|
|
149
|
+
|
|
150
|
+
Make sure you're using Nuxt 3 (`nuxt: ">=3.0.0"`) and the module is listed
|
|
151
|
+
in the `modules` array (not `buildModules`).
|
|
152
|
+
|
|
153
|
+
### OpenTelemetry packages bundled by Nitro
|
|
154
|
+
|
|
155
|
+
The module automatically externalizes OTel packages. If you see bundling errors,
|
|
156
|
+
manually add to `nuxt.config.ts`:
|
|
157
|
+
|
|
158
|
+
```ts
|
|
159
|
+
export default defineNuxtConfig({
|
|
160
|
+
nitro: {
|
|
161
|
+
externals: {
|
|
162
|
+
external: ['securenow', '@opentelemetry/api', '@opentelemetry/sdk-node'],
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
```
|