UNPKG

@dudousxd/nestjs-telescope

Version:

Laravel Telescope-style observability console for NestJS — core: watchers, recorder, correlation, SQLite store, headless API.

72 lines 3.02 kB
export declare const EntryType: { readonly Request: "request"; readonly Query: "query"; readonly Job: "job"; readonly Exception: "exception"; readonly Mail: "mail"; readonly Cache: "cache"; readonly HttpClient: "http_client"; readonly Dump: "dump"; readonly Event: "event"; readonly Log: "log"; readonly Model: "model"; readonly Redis: "redis"; readonly Inertia: "inertia"; /** * A browser-reported error ingested via the public `POST /api/client-errors` * endpoint. Distinct from a server `Exception` (which the interceptor captures * in-process) so the dashboard, sampling, prune and archive can treat * front-end errors as their own stream — yet it carries the SAME `failed`/ * `client`/`user:<id>` tags and a family-hash so the `new-exception` alert and * the exception groupings compose over both. */ readonly ClientException: "client_exception"; /** * An on-demand CPU flamegraph capture, recorded by the opt-in profiler around a * sampled/triggered request. Its `content` is the AGGREGATED frame tree (see * {@link CpuProfileContent}), not the raw `.cpuprofile` — keeping the entry body * bounded. Associated to its request by `batchId`/`traceId` like any entry. */ readonly CpuProfile: "cpu_profile"; }; export type BuiltinEntryType = (typeof EntryType)[keyof typeof EntryType]; declare const BATCH_ORIGINS: readonly ["http", "queue", "schedule", "cli", "manual"]; export type BatchOrigin = (typeof BATCH_ORIGINS)[number]; export declare function isBatchOrigin(value: unknown): value is BatchOrigin; /** A captured, persisted record. `content` is type-specific (see content.ts). */ export interface Entry<TContent = unknown> { id: string; batchId: string; type: string; familyHash: string | null; content: TContent; tags: string[]; sequence: number; durationMs: number | null; origin: BatchOrigin; instanceId: string; /** Active OTel trace id at record time, or null when no span / no provider. */ traceId: string | null; /** Active OTel span id at record time, or null when no span / no provider. */ spanId: string | null; createdAt: Date; } /** What a watcher hands to the Recorder. Everything else is filled in by enrichment. */ export interface RecordInput<TContent = unknown> { type: string; content: TContent; familyHash?: string | null; tags?: string[]; durationMs?: number | null; startedAt?: Date; /** * Explicit trace correlation id, for a watcher that already knows it (e.g. a * span envelope carrying its own `traceId`). When present it takes * precedence over BOTH the ambient OTel {@link TraceContextProvider} and the * `contextAccessor` fallback — see `Recorder.enrich`'s stamping order. When * absent, ambient enrichment behaves exactly as before this field existed. */ traceId?: string; } export {}; //# sourceMappingURL=entry.d.ts.map