@zintrust/trace 1.6.6 → 1.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.
Files changed (52) hide show
  1. package/dist/build-manifest.json +10 -22
  2. package/package.json +3 -4
  3. package/dist/storage/DebuggerStorage.d.ts +0 -13
  4. package/dist/storage/DebuggerStorage.js +0 -195
  5. package/src/TraceConnection.ts +0 -182
  6. package/src/cli-register.ts +0 -63
  7. package/src/config.ts +0 -383
  8. package/src/context.ts +0 -101
  9. package/src/dashboard/handlers.ts +0 -353
  10. package/src/dashboard/routes.ts +0 -114
  11. package/src/dashboard/ui.ts +0 -1262
  12. package/src/dashboard/zintrust-debuger.svg +0 -30
  13. package/src/index.ts +0 -102
  14. package/src/ingest/TraceIngestGateway.ts +0 -414
  15. package/src/plugin.ts +0 -9
  16. package/src/register.ts +0 -702
  17. package/src/storage/ProxyTraceStorage.ts +0 -190
  18. package/src/storage/TraceContentBudget.ts +0 -493
  19. package/src/storage/TraceContentRedaction.ts +0 -44
  20. package/src/storage/TraceEntryFiltering.ts +0 -50
  21. package/src/storage/TraceServiceTag.ts +0 -56
  22. package/src/storage/TraceStorage.ts +0 -543
  23. package/src/storage/TraceWriteDiagnostics.ts +0 -289
  24. package/src/storage/index.ts +0 -4
  25. package/src/types.ts +0 -430
  26. package/src/ui.ts +0 -9
  27. package/src/utils/authTag.ts +0 -20
  28. package/src/utils/entryFilter.ts +0 -131
  29. package/src/utils/familyHash.ts +0 -8
  30. package/src/utils/redact.ts +0 -112
  31. package/src/utils/requestFilter.ts +0 -79
  32. package/src/utils/stackFrame.ts +0 -44
  33. package/src/watchers/AuthWatcher.ts +0 -53
  34. package/src/watchers/BatchWatcher.ts +0 -55
  35. package/src/watchers/CacheWatcher.ts +0 -72
  36. package/src/watchers/CommandWatcher.ts +0 -58
  37. package/src/watchers/DumpWatcher.ts +0 -45
  38. package/src/watchers/EventWatcher.ts +0 -46
  39. package/src/watchers/ExceptionWatcher.ts +0 -130
  40. package/src/watchers/GateWatcher.ts +0 -53
  41. package/src/watchers/HttpClientWatcher.ts +0 -219
  42. package/src/watchers/HttpWatcher.ts +0 -249
  43. package/src/watchers/JobWatcher.ts +0 -124
  44. package/src/watchers/LogWatcher.ts +0 -120
  45. package/src/watchers/MailWatcher.ts +0 -65
  46. package/src/watchers/MiddlewareWatcher.ts +0 -54
  47. package/src/watchers/ModelWatcher.ts +0 -60
  48. package/src/watchers/NotificationWatcher.ts +0 -60
  49. package/src/watchers/QueryWatcher.ts +0 -105
  50. package/src/watchers/RedisWatcher.ts +0 -42
  51. package/src/watchers/ScheduleWatcher.ts +0 -57
  52. package/src/watchers/ViewWatcher.ts +0 -40
@@ -1,40 +0,0 @@
1
- import { TraceContext } from '../context';
2
- import type { ITraceWatcher, ITraceWatcherConfig, ViewContent } from '../types';
3
- import { EntryType } from '../types';
4
- import { RequestFilter } from '../utils/requestFilter';
5
-
6
- let _storage: ITraceWatcherConfig['storage'] | null = null;
7
- let _ignoreRoutes: string[] = [];
8
- let _ignorePaths: string[] = [];
9
-
10
- const emit = (template: string, duration: number): void => {
11
- if (!_storage) return;
12
- if (RequestFilter.shouldIgnoreCurrentRequest(_ignoreRoutes, _ignorePaths)) return;
13
- const content: ViewContent = { template, duration, hostname: TraceContext.getHostname() };
14
- _storage
15
- .writeEntry({
16
- uuid: crypto.randomUUID(),
17
- batchId: TraceContext.getBatchId(),
18
- type: EntryType.VIEW,
19
- content,
20
- tags: [template],
21
- isLatest: true,
22
- createdAt: TraceContext.now(),
23
- })
24
- .catch(() => undefined);
25
- };
26
-
27
- export const ViewWatcher: ITraceWatcher & { emit: typeof emit } = Object.freeze({
28
- emit,
29
- register({ storage, config }: ITraceWatcherConfig): () => void {
30
- if (config.watchers.view === false) return () => undefined;
31
- _storage = storage;
32
- _ignoreRoutes = config.ignoreRoutes;
33
- _ignorePaths = config.ignorePaths;
34
- return () => {
35
- _storage = null;
36
- _ignoreRoutes = [];
37
- _ignorePaths = [];
38
- };
39
- },
40
- });