@zintrust/trace 1.6.6 → 1.6.7

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