@zintrust/trace 1.6.1 → 1.6.3

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