@deeptracer/core 0.2.0 → 0.3.1
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.
- package/dist/chunk-XVDM75HZ.js +601 -0
- package/dist/index.cjs +333 -112
- package/dist/index.d.cts +5 -219
- package/dist/index.d.ts +5 -219
- package/dist/index.js +5 -1
- package/dist/internal-DdKQRgCs.d.cts +375 -0
- package/dist/internal-DdKQRgCs.d.ts +375 -0
- package/dist/internal.cjs +329 -112
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-LSMMIS4A.js +0 -382
package/dist/index.d.cts
CHANGED
|
@@ -1,221 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
* Configuration for creating a DeepTracer logger instance.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* ```ts
|
|
6
|
-
* const config: LoggerConfig = {
|
|
7
|
-
* product: "my-app",
|
|
8
|
-
* service: "api-server",
|
|
9
|
-
* environment: "production",
|
|
10
|
-
* endpoint: "https://deeptracer.example.com",
|
|
11
|
-
* apiKey: "dt_live_xxx",
|
|
12
|
-
* }
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
interface LoggerConfig {
|
|
16
|
-
/** Product name (e.g., "spotbeam", "macro") */
|
|
17
|
-
product: string;
|
|
18
|
-
/** Service name (e.g., "api", "worker", "web") */
|
|
19
|
-
service: string;
|
|
20
|
-
/** Deployment environment */
|
|
21
|
-
environment: "production" | "staging";
|
|
22
|
-
/** DeepTracer ingestion endpoint URL */
|
|
23
|
-
endpoint: string;
|
|
24
|
-
/** DeepTracer API key for authentication */
|
|
25
|
-
apiKey: string;
|
|
26
|
-
/** Number of log entries to batch before sending. Default: 50 */
|
|
27
|
-
batchSize?: number;
|
|
28
|
-
/** Milliseconds between automatic batch flushes. Default: 5000 */
|
|
29
|
-
flushIntervalMs?: number;
|
|
30
|
-
/** Enable console output for all log calls (useful for local development) */
|
|
31
|
-
debug?: boolean;
|
|
32
|
-
}
|
|
33
|
-
/** Log severity level */
|
|
34
|
-
type LogLevel = "debug" | "info" | "warn" | "error";
|
|
35
|
-
/**
|
|
36
|
-
* A single log entry sent to the DeepTracer backend.
|
|
37
|
-
* Created internally by the Logger — you don't construct these manually.
|
|
38
|
-
*/
|
|
39
|
-
interface LogEntry {
|
|
40
|
-
timestamp: string;
|
|
41
|
-
level: LogLevel;
|
|
42
|
-
message: string;
|
|
43
|
-
metadata?: Record<string, unknown>;
|
|
44
|
-
trace_id?: string;
|
|
45
|
-
span_id?: string;
|
|
46
|
-
request_id?: string;
|
|
47
|
-
vercel_id?: string;
|
|
48
|
-
context?: string;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Error report sent to DeepTracer for tracking and alerting.
|
|
52
|
-
*/
|
|
53
|
-
interface ErrorReport {
|
|
54
|
-
error_message: string;
|
|
55
|
-
stack_trace: string;
|
|
56
|
-
severity: "low" | "medium" | "high" | "critical";
|
|
57
|
-
context?: Record<string, unknown>;
|
|
58
|
-
trace_id?: string;
|
|
59
|
-
user_id?: string;
|
|
60
|
-
breadcrumbs?: Array<{
|
|
61
|
-
type: string;
|
|
62
|
-
message: string;
|
|
63
|
-
timestamp: string;
|
|
64
|
-
}>;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* LLM usage report for tracking AI costs and performance.
|
|
68
|
-
*/
|
|
69
|
-
interface LLMUsageReport {
|
|
70
|
-
model: string;
|
|
71
|
-
provider: string;
|
|
72
|
-
operation: string;
|
|
73
|
-
inputTokens: number;
|
|
74
|
-
outputTokens: number;
|
|
75
|
-
latencyMs: number;
|
|
76
|
-
costUsd?: number;
|
|
77
|
-
metadata?: Record<string, unknown>;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Raw span data sent to the DeepTracer backend.
|
|
81
|
-
*/
|
|
82
|
-
interface SpanData {
|
|
83
|
-
trace_id: string;
|
|
84
|
-
span_id: string;
|
|
85
|
-
parent_span_id: string;
|
|
86
|
-
operation: string;
|
|
87
|
-
start_time: string;
|
|
88
|
-
duration_ms: number;
|
|
89
|
-
status: "ok" | "error";
|
|
90
|
-
metadata?: Record<string, unknown>;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* A span representing a unit of work within a trace.
|
|
94
|
-
* Returned by the callback-based `startSpan()` — lifecycle is managed automatically.
|
|
95
|
-
*/
|
|
96
|
-
interface Span {
|
|
97
|
-
/** Trace ID linking all spans in a distributed trace */
|
|
98
|
-
traceId: string;
|
|
99
|
-
/** Unique ID for this span */
|
|
100
|
-
spanId: string;
|
|
101
|
-
/** ID of the parent span (empty string if root span) */
|
|
102
|
-
parentSpanId: string;
|
|
103
|
-
/** Operation name (e.g., "db-query", "fetch-user") */
|
|
104
|
-
operation: string;
|
|
105
|
-
/** Returns headers for propagating trace context to downstream services */
|
|
106
|
-
getHeaders(): Record<string, string>;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* A span with manual lifecycle control. You must call `.end()` when done.
|
|
110
|
-
*/
|
|
111
|
-
interface InactiveSpan extends Span {
|
|
112
|
-
/** End the span and send timing data to DeepTracer */
|
|
113
|
-
end(options?: {
|
|
114
|
-
status?: "ok" | "error";
|
|
115
|
-
metadata?: Record<string, unknown>;
|
|
116
|
-
}): void;
|
|
117
|
-
/** Create a child span with callback-based lifecycle (auto-ends) */
|
|
118
|
-
startSpan<T>(operation: string, fn: (span: Span) => T): T;
|
|
119
|
-
/** Create a child span with manual lifecycle (you must call .end()) */
|
|
120
|
-
startInactiveSpan(operation: string): InactiveSpan;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Options for HTTP middleware (Hono, Express).
|
|
124
|
-
*/
|
|
125
|
-
interface MiddlewareOptions {
|
|
126
|
-
/** Custom function to generate the span operation name. Default: "{METHOD} {path}" */
|
|
127
|
-
operationName?: (method: string, path: string) => string;
|
|
128
|
-
/** Paths to exclude from tracing (e.g., ["/health", "/ready"]) */
|
|
129
|
-
ignorePaths?: string[];
|
|
130
|
-
}
|
|
1
|
+
export { B as BeforeSendEvent, a as Breadcrumb, E as ErrorReport, I as InactiveSpan, L as LLMUsageReport, b as LogEntry, c as LogLevel, d as Logger, e as LoggerConfig, M as MiddlewareOptions, S as Span, f as SpanData, U as User, g as createLogger } from './internal-DdKQRgCs.cjs';
|
|
131
2
|
|
|
132
|
-
/**
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
* when captureConsole() is active.
|
|
136
|
-
*
|
|
137
|
-
* @internal Exported for use by @deeptracer/node and @deeptracer/browser.
|
|
138
|
-
*/
|
|
139
|
-
declare const _originalConsole: {
|
|
140
|
-
log: (...data: any[]) => void;
|
|
141
|
-
info: (...data: any[]) => void;
|
|
142
|
-
warn: (...data: any[]) => void;
|
|
143
|
-
error: (...data: any[]) => void;
|
|
144
|
-
debug: (...data: any[]) => void;
|
|
145
|
-
};
|
|
146
|
-
/**
|
|
147
|
-
* DeepTracer Logger — lightweight observability SDK for logging, errors, tracing, and LLM usage.
|
|
148
|
-
*
|
|
149
|
-
* @example
|
|
150
|
-
* ```ts
|
|
151
|
-
* import { createLogger } from "@deeptracer/core"
|
|
152
|
-
*
|
|
153
|
-
* const logger = createLogger({
|
|
154
|
-
* product: "my-app",
|
|
155
|
-
* service: "api",
|
|
156
|
-
* environment: "production",
|
|
157
|
-
* endpoint: "https://deeptracer.example.com",
|
|
158
|
-
* apiKey: "dt_live_xxx",
|
|
159
|
-
* })
|
|
160
|
-
*
|
|
161
|
-
* logger.info("Server started", { port: 3000 })
|
|
162
|
-
* ```
|
|
163
|
-
*/
|
|
164
|
-
declare class Logger {
|
|
165
|
-
private batcher;
|
|
166
|
-
private transport;
|
|
167
|
-
protected contextName?: string;
|
|
168
|
-
protected config: LoggerConfig;
|
|
169
|
-
protected requestMeta?: {
|
|
170
|
-
trace_id?: string;
|
|
171
|
-
span_id?: string;
|
|
172
|
-
request_id?: string;
|
|
173
|
-
vercel_id?: string;
|
|
174
|
-
};
|
|
175
|
-
constructor(config: LoggerConfig, contextName?: string, requestMeta?: {
|
|
176
|
-
trace_id?: string;
|
|
177
|
-
span_id?: string;
|
|
178
|
-
request_id?: string;
|
|
179
|
-
vercel_id?: string;
|
|
180
|
-
});
|
|
181
|
-
private log;
|
|
182
|
-
/** Log a debug message. */
|
|
183
|
-
debug(message: string, dataOrError?: Record<string, unknown> | unknown, error?: unknown): void;
|
|
184
|
-
/** Log an informational message. */
|
|
185
|
-
info(message: string, dataOrError?: Record<string, unknown> | unknown, error?: unknown): void;
|
|
186
|
-
/** Log a warning. */
|
|
187
|
-
warn(message: string, dataOrError?: Record<string, unknown> | unknown, error?: unknown): void;
|
|
188
|
-
/** Log an error. */
|
|
189
|
-
error(message: string, dataOrError?: Record<string, unknown> | unknown, error?: unknown): void;
|
|
190
|
-
/** Create a context-scoped logger. All logs include the context name. */
|
|
191
|
-
withContext(name: string): Logger;
|
|
192
|
-
/** Create a request-scoped logger that extracts trace context from headers. */
|
|
193
|
-
forRequest(request: Request): Logger;
|
|
194
|
-
/** Capture and report an error immediately (not batched). */
|
|
195
|
-
captureError(error: Error | unknown, context?: {
|
|
196
|
-
severity?: "low" | "medium" | "high" | "critical";
|
|
197
|
-
userId?: string;
|
|
198
|
-
context?: Record<string, unknown>;
|
|
199
|
-
breadcrumbs?: Array<{
|
|
200
|
-
type: string;
|
|
201
|
-
message: string;
|
|
202
|
-
timestamp: string;
|
|
203
|
-
}>;
|
|
204
|
-
}): void;
|
|
205
|
-
/** Track LLM usage. Sends to /ingest/llm and logs for visibility. */
|
|
206
|
-
llmUsage(report: LLMUsageReport): void;
|
|
207
|
-
/** Start a span with automatic lifecycle (callback-based, recommended). */
|
|
208
|
-
startSpan<T>(operation: string, fn: (span: Span) => T): T;
|
|
209
|
-
/** Start a span with manual lifecycle. You must call span.end(). */
|
|
210
|
-
startInactiveSpan(operation: string): InactiveSpan;
|
|
211
|
-
/** Wrap a function with automatic tracing and error capture. */
|
|
212
|
-
wrap<TArgs extends unknown[], TReturn>(operation: string, fn: (...args: TArgs) => TReturn): (...args: TArgs) => TReturn;
|
|
213
|
-
/** Immediately flush all batched log entries. */
|
|
214
|
-
flush(): void;
|
|
215
|
-
/** Stop the batch timer and flush remaining logs. */
|
|
216
|
-
destroy(): void;
|
|
217
|
-
}
|
|
218
|
-
/** Create a new DeepTracer logger instance. */
|
|
219
|
-
declare function createLogger(config: LoggerConfig): Logger;
|
|
3
|
+
/** SDK version. Update on each release. */
|
|
4
|
+
declare const SDK_VERSION = "0.3.1";
|
|
5
|
+
declare const SDK_NAME = "core";
|
|
220
6
|
|
|
221
|
-
export {
|
|
7
|
+
export { SDK_NAME, SDK_VERSION };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,221 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
* Configuration for creating a DeepTracer logger instance.
|
|
3
|
-
*
|
|
4
|
-
* @example
|
|
5
|
-
* ```ts
|
|
6
|
-
* const config: LoggerConfig = {
|
|
7
|
-
* product: "my-app",
|
|
8
|
-
* service: "api-server",
|
|
9
|
-
* environment: "production",
|
|
10
|
-
* endpoint: "https://deeptracer.example.com",
|
|
11
|
-
* apiKey: "dt_live_xxx",
|
|
12
|
-
* }
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
interface LoggerConfig {
|
|
16
|
-
/** Product name (e.g., "spotbeam", "macro") */
|
|
17
|
-
product: string;
|
|
18
|
-
/** Service name (e.g., "api", "worker", "web") */
|
|
19
|
-
service: string;
|
|
20
|
-
/** Deployment environment */
|
|
21
|
-
environment: "production" | "staging";
|
|
22
|
-
/** DeepTracer ingestion endpoint URL */
|
|
23
|
-
endpoint: string;
|
|
24
|
-
/** DeepTracer API key for authentication */
|
|
25
|
-
apiKey: string;
|
|
26
|
-
/** Number of log entries to batch before sending. Default: 50 */
|
|
27
|
-
batchSize?: number;
|
|
28
|
-
/** Milliseconds between automatic batch flushes. Default: 5000 */
|
|
29
|
-
flushIntervalMs?: number;
|
|
30
|
-
/** Enable console output for all log calls (useful for local development) */
|
|
31
|
-
debug?: boolean;
|
|
32
|
-
}
|
|
33
|
-
/** Log severity level */
|
|
34
|
-
type LogLevel = "debug" | "info" | "warn" | "error";
|
|
35
|
-
/**
|
|
36
|
-
* A single log entry sent to the DeepTracer backend.
|
|
37
|
-
* Created internally by the Logger — you don't construct these manually.
|
|
38
|
-
*/
|
|
39
|
-
interface LogEntry {
|
|
40
|
-
timestamp: string;
|
|
41
|
-
level: LogLevel;
|
|
42
|
-
message: string;
|
|
43
|
-
metadata?: Record<string, unknown>;
|
|
44
|
-
trace_id?: string;
|
|
45
|
-
span_id?: string;
|
|
46
|
-
request_id?: string;
|
|
47
|
-
vercel_id?: string;
|
|
48
|
-
context?: string;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Error report sent to DeepTracer for tracking and alerting.
|
|
52
|
-
*/
|
|
53
|
-
interface ErrorReport {
|
|
54
|
-
error_message: string;
|
|
55
|
-
stack_trace: string;
|
|
56
|
-
severity: "low" | "medium" | "high" | "critical";
|
|
57
|
-
context?: Record<string, unknown>;
|
|
58
|
-
trace_id?: string;
|
|
59
|
-
user_id?: string;
|
|
60
|
-
breadcrumbs?: Array<{
|
|
61
|
-
type: string;
|
|
62
|
-
message: string;
|
|
63
|
-
timestamp: string;
|
|
64
|
-
}>;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* LLM usage report for tracking AI costs and performance.
|
|
68
|
-
*/
|
|
69
|
-
interface LLMUsageReport {
|
|
70
|
-
model: string;
|
|
71
|
-
provider: string;
|
|
72
|
-
operation: string;
|
|
73
|
-
inputTokens: number;
|
|
74
|
-
outputTokens: number;
|
|
75
|
-
latencyMs: number;
|
|
76
|
-
costUsd?: number;
|
|
77
|
-
metadata?: Record<string, unknown>;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Raw span data sent to the DeepTracer backend.
|
|
81
|
-
*/
|
|
82
|
-
interface SpanData {
|
|
83
|
-
trace_id: string;
|
|
84
|
-
span_id: string;
|
|
85
|
-
parent_span_id: string;
|
|
86
|
-
operation: string;
|
|
87
|
-
start_time: string;
|
|
88
|
-
duration_ms: number;
|
|
89
|
-
status: "ok" | "error";
|
|
90
|
-
metadata?: Record<string, unknown>;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* A span representing a unit of work within a trace.
|
|
94
|
-
* Returned by the callback-based `startSpan()` — lifecycle is managed automatically.
|
|
95
|
-
*/
|
|
96
|
-
interface Span {
|
|
97
|
-
/** Trace ID linking all spans in a distributed trace */
|
|
98
|
-
traceId: string;
|
|
99
|
-
/** Unique ID for this span */
|
|
100
|
-
spanId: string;
|
|
101
|
-
/** ID of the parent span (empty string if root span) */
|
|
102
|
-
parentSpanId: string;
|
|
103
|
-
/** Operation name (e.g., "db-query", "fetch-user") */
|
|
104
|
-
operation: string;
|
|
105
|
-
/** Returns headers for propagating trace context to downstream services */
|
|
106
|
-
getHeaders(): Record<string, string>;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* A span with manual lifecycle control. You must call `.end()` when done.
|
|
110
|
-
*/
|
|
111
|
-
interface InactiveSpan extends Span {
|
|
112
|
-
/** End the span and send timing data to DeepTracer */
|
|
113
|
-
end(options?: {
|
|
114
|
-
status?: "ok" | "error";
|
|
115
|
-
metadata?: Record<string, unknown>;
|
|
116
|
-
}): void;
|
|
117
|
-
/** Create a child span with callback-based lifecycle (auto-ends) */
|
|
118
|
-
startSpan<T>(operation: string, fn: (span: Span) => T): T;
|
|
119
|
-
/** Create a child span with manual lifecycle (you must call .end()) */
|
|
120
|
-
startInactiveSpan(operation: string): InactiveSpan;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Options for HTTP middleware (Hono, Express).
|
|
124
|
-
*/
|
|
125
|
-
interface MiddlewareOptions {
|
|
126
|
-
/** Custom function to generate the span operation name. Default: "{METHOD} {path}" */
|
|
127
|
-
operationName?: (method: string, path: string) => string;
|
|
128
|
-
/** Paths to exclude from tracing (e.g., ["/health", "/ready"]) */
|
|
129
|
-
ignorePaths?: string[];
|
|
130
|
-
}
|
|
1
|
+
export { B as BeforeSendEvent, a as Breadcrumb, E as ErrorReport, I as InactiveSpan, L as LLMUsageReport, b as LogEntry, c as LogLevel, d as Logger, e as LoggerConfig, M as MiddlewareOptions, S as Span, f as SpanData, U as User, g as createLogger } from './internal-DdKQRgCs.js';
|
|
131
2
|
|
|
132
|
-
/**
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
* when captureConsole() is active.
|
|
136
|
-
*
|
|
137
|
-
* @internal Exported for use by @deeptracer/node and @deeptracer/browser.
|
|
138
|
-
*/
|
|
139
|
-
declare const _originalConsole: {
|
|
140
|
-
log: (...data: any[]) => void;
|
|
141
|
-
info: (...data: any[]) => void;
|
|
142
|
-
warn: (...data: any[]) => void;
|
|
143
|
-
error: (...data: any[]) => void;
|
|
144
|
-
debug: (...data: any[]) => void;
|
|
145
|
-
};
|
|
146
|
-
/**
|
|
147
|
-
* DeepTracer Logger — lightweight observability SDK for logging, errors, tracing, and LLM usage.
|
|
148
|
-
*
|
|
149
|
-
* @example
|
|
150
|
-
* ```ts
|
|
151
|
-
* import { createLogger } from "@deeptracer/core"
|
|
152
|
-
*
|
|
153
|
-
* const logger = createLogger({
|
|
154
|
-
* product: "my-app",
|
|
155
|
-
* service: "api",
|
|
156
|
-
* environment: "production",
|
|
157
|
-
* endpoint: "https://deeptracer.example.com",
|
|
158
|
-
* apiKey: "dt_live_xxx",
|
|
159
|
-
* })
|
|
160
|
-
*
|
|
161
|
-
* logger.info("Server started", { port: 3000 })
|
|
162
|
-
* ```
|
|
163
|
-
*/
|
|
164
|
-
declare class Logger {
|
|
165
|
-
private batcher;
|
|
166
|
-
private transport;
|
|
167
|
-
protected contextName?: string;
|
|
168
|
-
protected config: LoggerConfig;
|
|
169
|
-
protected requestMeta?: {
|
|
170
|
-
trace_id?: string;
|
|
171
|
-
span_id?: string;
|
|
172
|
-
request_id?: string;
|
|
173
|
-
vercel_id?: string;
|
|
174
|
-
};
|
|
175
|
-
constructor(config: LoggerConfig, contextName?: string, requestMeta?: {
|
|
176
|
-
trace_id?: string;
|
|
177
|
-
span_id?: string;
|
|
178
|
-
request_id?: string;
|
|
179
|
-
vercel_id?: string;
|
|
180
|
-
});
|
|
181
|
-
private log;
|
|
182
|
-
/** Log a debug message. */
|
|
183
|
-
debug(message: string, dataOrError?: Record<string, unknown> | unknown, error?: unknown): void;
|
|
184
|
-
/** Log an informational message. */
|
|
185
|
-
info(message: string, dataOrError?: Record<string, unknown> | unknown, error?: unknown): void;
|
|
186
|
-
/** Log a warning. */
|
|
187
|
-
warn(message: string, dataOrError?: Record<string, unknown> | unknown, error?: unknown): void;
|
|
188
|
-
/** Log an error. */
|
|
189
|
-
error(message: string, dataOrError?: Record<string, unknown> | unknown, error?: unknown): void;
|
|
190
|
-
/** Create a context-scoped logger. All logs include the context name. */
|
|
191
|
-
withContext(name: string): Logger;
|
|
192
|
-
/** Create a request-scoped logger that extracts trace context from headers. */
|
|
193
|
-
forRequest(request: Request): Logger;
|
|
194
|
-
/** Capture and report an error immediately (not batched). */
|
|
195
|
-
captureError(error: Error | unknown, context?: {
|
|
196
|
-
severity?: "low" | "medium" | "high" | "critical";
|
|
197
|
-
userId?: string;
|
|
198
|
-
context?: Record<string, unknown>;
|
|
199
|
-
breadcrumbs?: Array<{
|
|
200
|
-
type: string;
|
|
201
|
-
message: string;
|
|
202
|
-
timestamp: string;
|
|
203
|
-
}>;
|
|
204
|
-
}): void;
|
|
205
|
-
/** Track LLM usage. Sends to /ingest/llm and logs for visibility. */
|
|
206
|
-
llmUsage(report: LLMUsageReport): void;
|
|
207
|
-
/** Start a span with automatic lifecycle (callback-based, recommended). */
|
|
208
|
-
startSpan<T>(operation: string, fn: (span: Span) => T): T;
|
|
209
|
-
/** Start a span with manual lifecycle. You must call span.end(). */
|
|
210
|
-
startInactiveSpan(operation: string): InactiveSpan;
|
|
211
|
-
/** Wrap a function with automatic tracing and error capture. */
|
|
212
|
-
wrap<TArgs extends unknown[], TReturn>(operation: string, fn: (...args: TArgs) => TReturn): (...args: TArgs) => TReturn;
|
|
213
|
-
/** Immediately flush all batched log entries. */
|
|
214
|
-
flush(): void;
|
|
215
|
-
/** Stop the batch timer and flush remaining logs. */
|
|
216
|
-
destroy(): void;
|
|
217
|
-
}
|
|
218
|
-
/** Create a new DeepTracer logger instance. */
|
|
219
|
-
declare function createLogger(config: LoggerConfig): Logger;
|
|
3
|
+
/** SDK version. Update on each release. */
|
|
4
|
+
declare const SDK_VERSION = "0.3.1";
|
|
5
|
+
declare const SDK_NAME = "core";
|
|
220
6
|
|
|
221
|
-
export {
|
|
7
|
+
export { SDK_NAME, SDK_VERSION };
|