@zintrust/trace 1.6.0 → 1.6.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.
Files changed (53) hide show
  1. package/dist/build-manifest.json +22 -10
  2. package/dist/register.js +14 -10
  3. package/dist/storage/DebuggerStorage.d.ts +13 -0
  4. package/dist/storage/DebuggerStorage.js +195 -0
  5. package/package.json +3 -4
  6. package/src/TraceConnection.ts +0 -182
  7. package/src/cli-register.ts +0 -63
  8. package/src/config.ts +0 -383
  9. package/src/context.ts +0 -101
  10. package/src/dashboard/handlers.ts +0 -353
  11. package/src/dashboard/routes.ts +0 -114
  12. package/src/dashboard/ui.ts +0 -1262
  13. package/src/dashboard/zintrust-debuger.svg +0 -30
  14. package/src/index.ts +0 -102
  15. package/src/ingest/TraceIngestGateway.ts +0 -414
  16. package/src/plugin.ts +0 -9
  17. package/src/register.ts +0 -659
  18. package/src/storage/ProxyTraceStorage.ts +0 -190
  19. package/src/storage/TraceContentBudget.ts +0 -491
  20. package/src/storage/TraceContentRedaction.ts +0 -44
  21. package/src/storage/TraceEntryFiltering.ts +0 -92
  22. package/src/storage/TraceServiceTag.ts +0 -56
  23. package/src/storage/TraceStorage.ts +0 -543
  24. package/src/storage/TraceWriteDiagnostics.ts +0 -289
  25. package/src/storage/index.ts +0 -4
  26. package/src/types.ts +0 -430
  27. package/src/ui.ts +0 -9
  28. package/src/utils/authTag.ts +0 -20
  29. package/src/utils/entryFilter.ts +0 -131
  30. package/src/utils/familyHash.ts +0 -8
  31. package/src/utils/redact.ts +0 -112
  32. package/src/utils/requestFilter.ts +0 -79
  33. package/src/utils/stackFrame.ts +0 -44
  34. package/src/watchers/AuthWatcher.ts +0 -53
  35. package/src/watchers/BatchWatcher.ts +0 -55
  36. package/src/watchers/CacheWatcher.ts +0 -72
  37. package/src/watchers/CommandWatcher.ts +0 -58
  38. package/src/watchers/DumpWatcher.ts +0 -45
  39. package/src/watchers/EventWatcher.ts +0 -46
  40. package/src/watchers/ExceptionWatcher.ts +0 -130
  41. package/src/watchers/GateWatcher.ts +0 -53
  42. package/src/watchers/HttpClientWatcher.ts +0 -219
  43. package/src/watchers/HttpWatcher.ts +0 -220
  44. package/src/watchers/JobWatcher.ts +0 -124
  45. package/src/watchers/LogWatcher.ts +0 -120
  46. package/src/watchers/MailWatcher.ts +0 -65
  47. package/src/watchers/MiddlewareWatcher.ts +0 -54
  48. package/src/watchers/ModelWatcher.ts +0 -60
  49. package/src/watchers/NotificationWatcher.ts +0 -60
  50. package/src/watchers/QueryWatcher.ts +0 -107
  51. package/src/watchers/RedisWatcher.ts +0 -42
  52. package/src/watchers/ScheduleWatcher.ts +0 -57
  53. 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
- });