@oneteme/inspect-ng-collector 1.3.3 → 1.3.4-beta.2
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 +55 -68
- package/fesm2022/oneteme-inspect-ng-collector.mjs +613 -220
- package/fesm2022/oneteme-inspect-ng-collector.mjs.map +1 -1
- package/lib/configuration.d.ts +114 -79
- package/lib/event-bus.d.ts +6 -5
- package/lib/event-trace-scheduled-dispatcher.service.d.ts +14 -0
- package/lib/local-request.monitor.d.ts +2 -2
- package/lib/log.monitor.d.ts +1 -0
- package/lib/rest-request.monitor.d.ts +1 -1
- package/lib/session-manager.service.d.ts +8 -7
- package/lib/trace.model.d.ts +49 -16
- package/lib/traceable-stage.decorator.d.ts +0 -4
- package/package.json +1 -1
- package/lib/event-trace-debugger.d.ts +0 -25
package/README.md
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@oneteme/inspect-ng-collector)
|
|
4
4
|
[](LICENSE)
|
|
5
5
|
[](https://angular.io)
|
|
6
|
-
[](#testing)
|
|
7
6
|
|
|
8
7
|
A comprehensive **front-end telemetry and monitoring library for Angular applications**. Automatically collect user interactions, HTTP requests, navigation events, performance metrics, and errors—then send them to your backend analytics service.
|
|
9
8
|
|
|
@@ -34,11 +33,6 @@ A comprehensive **front-end telemetry and monitoring library for Angular applica
|
|
|
34
33
|
- Environment and version tracking
|
|
35
34
|
- Debug mode for development
|
|
36
35
|
|
|
37
|
-
- **🧪 Fully Tested**
|
|
38
|
-
- 150+ unit test cases
|
|
39
|
-
- 80%+ code coverage
|
|
40
|
-
- Comprehensive test documentation
|
|
41
|
-
|
|
42
36
|
## 📦 Installation
|
|
43
37
|
|
|
44
38
|
```bash
|
|
@@ -133,59 +127,48 @@ export class MyService {
|
|
|
133
127
|
|
|
134
128
|
```typescript
|
|
135
129
|
NgCollectorModule.forRoot({
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
// Additional Properties
|
|
147
|
-
additionalProperties: () => ({
|
|
148
|
-
customProperty: 'value',
|
|
149
|
-
userId: getUserId()
|
|
150
|
-
}),
|
|
151
|
-
|
|
152
|
-
// Scheduling
|
|
153
|
-
scheduling: {
|
|
154
|
-
interval: 30000 // Export interval in ms (default: 30s)
|
|
155
|
-
},
|
|
156
|
-
|
|
157
|
-
// Monitoring Configuration
|
|
158
|
-
monitoring: {
|
|
159
|
-
// HTTP Monitoring
|
|
160
|
-
httpRoute: {
|
|
161
|
-
excludes: {
|
|
162
|
-
path: [/\/health$/, /\/status$/] // Exclude paths from tracking
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
httpRequest: {
|
|
166
|
-
excludes: {
|
|
167
|
-
host: ['localhost:4200'] // Exclude hosts
|
|
168
|
-
}
|
|
130
|
+
collector: {
|
|
131
|
+
enabled: true,
|
|
132
|
+
debugMode: false,
|
|
133
|
+
application: {
|
|
134
|
+
name: 'my-app',
|
|
135
|
+
namespace: 'jarvis',
|
|
136
|
+
version: () => getAppVersion(),
|
|
137
|
+
env: 'production',
|
|
138
|
+
user: 'john@example.com'
|
|
169
139
|
},
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
140
|
+
additionalProperties: () => ({
|
|
141
|
+
customProperty: 'value',
|
|
142
|
+
userId: getUserId()
|
|
143
|
+
}),
|
|
144
|
+
scheduling: {
|
|
145
|
+
interval: 30000, // milliseconds; default: 60000
|
|
146
|
+
queueCapacity: 1000
|
|
173
147
|
},
|
|
174
|
-
|
|
175
|
-
|
|
148
|
+
monitoring: {
|
|
149
|
+
httpRoute: {
|
|
150
|
+
excludes: {
|
|
151
|
+
path: [/\/health$/, /\/status$/]
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
httpRequest: {
|
|
155
|
+
excludes: {
|
|
156
|
+
host: ['localhost:4200']
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
resources: { enabled: true },
|
|
160
|
+
analytics: { enabled: true },
|
|
161
|
+
logger: { enabled: true }, // Capture console.warn and console.error
|
|
162
|
+
reporter: { enabled: true }, // Send internal collector reports
|
|
163
|
+
storage: { enabled: false }
|
|
176
164
|
},
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
queueCapacity: 1000, // Max events in queue
|
|
185
|
-
remote: {
|
|
186
|
-
host: 'https://analytics.example.com',
|
|
187
|
-
mode: 'cors',
|
|
188
|
-
retentionMaxAge: 86400000 // 24 hours
|
|
165
|
+
tracing: {
|
|
166
|
+
remote: {
|
|
167
|
+
host: 'https://analytics.example.com',
|
|
168
|
+
mode: 'cors',
|
|
169
|
+
token: () => getCollectorToken(),
|
|
170
|
+
retentionMaxAge: { audit: 7, diagnostics: 10 }
|
|
171
|
+
}
|
|
189
172
|
}
|
|
190
173
|
}
|
|
191
174
|
})
|
|
@@ -195,18 +178,22 @@ NgCollectorModule.forRoot({
|
|
|
195
178
|
|
|
196
179
|
| Property | Type | Default | Description |
|
|
197
180
|
|----------|------|---------|-------------|
|
|
198
|
-
| `enabled` | boolean | false | Enable/disable collection |
|
|
199
|
-
| `debugMode` | boolean | false | Enable debug output |
|
|
200
|
-
| `name` | string \| function | required | Application name |
|
|
201
|
-
| `
|
|
202
|
-
| `env` | string \| function |
|
|
203
|
-
| `user` | string \| function | optional | Current user identifier |
|
|
204
|
-
| `
|
|
205
|
-
| `scheduling.
|
|
206
|
-
| `monitoring.resources.enabled` | boolean | false | Track memory metrics |
|
|
207
|
-
| `monitoring.analytics.enabled` | boolean | false | Track user interactions |
|
|
208
|
-
| `
|
|
209
|
-
| `
|
|
181
|
+
| `collector.enabled` | boolean | false | Enable/disable collection |
|
|
182
|
+
| `collector.debugMode` | boolean | false | Enable debug output |
|
|
183
|
+
| `collector.application.name` | string \| function | required | Application name |
|
|
184
|
+
| `collector.application.namespace` | string \| function | required | Application namespace |
|
|
185
|
+
| `collector.application.env` | string \| function | required | Environment (prod, dev, etc.) |
|
|
186
|
+
| `collector.application.user` | string \| function | optional | Current user identifier |
|
|
187
|
+
| `collector.scheduling.interval` | number | 60000 | Event export interval (ms) |
|
|
188
|
+
| `collector.scheduling.queueCapacity` | number | 1000 | Maximum queued traces |
|
|
189
|
+
| `collector.monitoring.resources.enabled` | boolean | false | Track memory metrics |
|
|
190
|
+
| `collector.monitoring.analytics.enabled` | boolean | false | Track user interactions |
|
|
191
|
+
| `collector.monitoring.logger.enabled` | boolean | false | Capture `console.warn()` and `console.error()` calls |
|
|
192
|
+
| `collector.monitoring.reporter.enabled` | boolean | false | Send internal collector reports |
|
|
193
|
+
| `collector.tracing.remote.host` | string | `http://localhost` | Backend analytics endpoint |
|
|
194
|
+
| `collector.tracing.remote.token` | string \| function | empty | Backend authentication token |
|
|
195
|
+
|
|
196
|
+
Console capture covers `warn` and `error`, not `log` or `info`. Captured messages are sent to the configured backend, so avoid logging secrets or other sensitive values.
|
|
210
197
|
|
|
211
198
|
## 📊 Collected Data
|
|
212
199
|
|