@juspay/neurolink 9.24.0 → 9.25.0
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/CHANGELOG.md +6 -0
- package/dist/adapters/tts/googleTTSHandler.js +26 -1
- package/dist/adapters/video/vertexVideoHandler.js +23 -17
- package/dist/cli/commands/config.d.ts +3 -3
- package/dist/cli/commands/observability.d.ts +53 -0
- package/dist/cli/commands/observability.js +453 -0
- package/dist/cli/commands/telemetry.d.ts +63 -0
- package/dist/cli/commands/telemetry.js +689 -0
- package/dist/cli/factories/commandFactory.js +29 -15
- package/dist/cli/parser.js +6 -9
- package/dist/cli/utils/formatters.d.ts +13 -0
- package/dist/cli/utils/formatters.js +23 -0
- package/dist/constants/contextWindows.js +6 -0
- package/dist/constants/enums.d.ts +6 -0
- package/dist/constants/enums.js +8 -2
- package/dist/context/budgetChecker.js +75 -48
- package/dist/context/contextCompactor.js +135 -127
- package/dist/core/baseProvider.d.ts +5 -0
- package/dist/core/baseProvider.js +158 -102
- package/dist/core/conversationMemoryInitializer.js +7 -4
- package/dist/core/conversationMemoryManager.d.ts +2 -0
- package/dist/core/conversationMemoryManager.js +6 -2
- package/dist/core/modules/GenerationHandler.d.ts +2 -2
- package/dist/core/modules/GenerationHandler.js +12 -12
- package/dist/evaluation/ragasEvaluator.js +39 -19
- package/dist/evaluation/scoring.js +46 -20
- package/dist/features/ppt/presentationOrchestrator.js +23 -0
- package/dist/features/ppt/slideGenerator.js +13 -0
- package/dist/features/ppt/slideRenderers.d.ts +1 -1
- package/dist/features/ppt/slideRenderers.js +6 -4
- package/dist/features/ppt/slideTypeInference.d.ts +1 -1
- package/dist/features/ppt/slideTypeInference.js +75 -73
- package/dist/files/fileTools.d.ts +6 -6
- package/dist/index.d.ts +46 -12
- package/dist/index.js +79 -17
- package/dist/lib/adapters/tts/googleTTSHandler.js +26 -1
- package/dist/lib/adapters/video/vertexVideoHandler.js +23 -17
- package/dist/lib/constants/contextWindows.js +6 -0
- package/dist/lib/constants/enums.d.ts +6 -0
- package/dist/lib/constants/enums.js +8 -2
- package/dist/lib/context/budgetChecker.js +75 -48
- package/dist/lib/context/contextCompactor.js +135 -127
- package/dist/lib/core/baseProvider.d.ts +5 -0
- package/dist/lib/core/baseProvider.js +158 -102
- package/dist/lib/core/conversationMemoryInitializer.js +7 -4
- package/dist/lib/core/conversationMemoryManager.d.ts +2 -0
- package/dist/lib/core/conversationMemoryManager.js +6 -2
- package/dist/lib/core/modules/GenerationHandler.d.ts +2 -2
- package/dist/lib/core/modules/GenerationHandler.js +12 -12
- package/dist/lib/evaluation/ragasEvaluator.js +39 -19
- package/dist/lib/evaluation/scoring.js +46 -20
- package/dist/lib/features/ppt/presentationOrchestrator.js +23 -0
- package/dist/lib/features/ppt/slideGenerator.js +13 -0
- package/dist/lib/features/ppt/slideRenderers.d.ts +1 -1
- package/dist/lib/features/ppt/slideRenderers.js +6 -4
- package/dist/lib/features/ppt/slideTypeInference.d.ts +1 -1
- package/dist/lib/features/ppt/slideTypeInference.js +75 -73
- package/dist/lib/files/fileTools.d.ts +6 -6
- package/dist/lib/index.d.ts +46 -12
- package/dist/lib/index.js +79 -17
- package/dist/lib/mcp/httpRateLimiter.js +39 -12
- package/dist/lib/mcp/httpRetryHandler.js +22 -1
- package/dist/lib/mcp/mcpClientFactory.js +13 -15
- package/dist/lib/memory/memoryRetrievalTools.js +22 -0
- package/dist/lib/neurolink.d.ts +64 -72
- package/dist/lib/neurolink.js +984 -566
- package/dist/lib/observability/exporterRegistry.d.ts +152 -0
- package/dist/lib/observability/exporterRegistry.js +414 -0
- package/dist/lib/observability/exporters/arizeExporter.d.ts +32 -0
- package/dist/lib/observability/exporters/arizeExporter.js +139 -0
- package/dist/lib/observability/exporters/baseExporter.d.ts +117 -0
- package/dist/lib/observability/exporters/baseExporter.js +191 -0
- package/dist/lib/observability/exporters/braintrustExporter.d.ts +30 -0
- package/dist/lib/observability/exporters/braintrustExporter.js +155 -0
- package/dist/lib/observability/exporters/datadogExporter.d.ts +37 -0
- package/dist/lib/observability/exporters/datadogExporter.js +197 -0
- package/dist/lib/observability/exporters/index.d.ts +13 -0
- package/dist/lib/observability/exporters/index.js +14 -0
- package/dist/lib/observability/exporters/laminarExporter.d.ts +48 -0
- package/dist/lib/observability/exporters/laminarExporter.js +303 -0
- package/dist/lib/observability/exporters/langfuseExporter.d.ts +47 -0
- package/dist/lib/observability/exporters/langfuseExporter.js +200 -0
- package/dist/lib/observability/exporters/langsmithExporter.d.ts +26 -0
- package/dist/lib/observability/exporters/langsmithExporter.js +124 -0
- package/dist/lib/observability/exporters/otelExporter.d.ts +39 -0
- package/dist/lib/observability/exporters/otelExporter.js +165 -0
- package/dist/lib/observability/exporters/posthogExporter.d.ts +48 -0
- package/dist/lib/observability/exporters/posthogExporter.js +288 -0
- package/dist/lib/observability/exporters/sentryExporter.d.ts +32 -0
- package/dist/lib/observability/exporters/sentryExporter.js +166 -0
- package/dist/lib/observability/index.d.ts +25 -0
- package/dist/lib/observability/index.js +32 -0
- package/dist/lib/observability/metricsAggregator.d.ts +260 -0
- package/dist/lib/observability/metricsAggregator.js +553 -0
- package/dist/lib/observability/otelBridge.d.ts +49 -0
- package/dist/lib/observability/otelBridge.js +132 -0
- package/dist/lib/observability/retryPolicy.d.ts +192 -0
- package/dist/lib/observability/retryPolicy.js +384 -0
- package/dist/lib/observability/sampling/index.d.ts +4 -0
- package/dist/lib/observability/sampling/index.js +5 -0
- package/dist/lib/observability/sampling/samplers.d.ts +116 -0
- package/dist/lib/observability/sampling/samplers.js +217 -0
- package/dist/lib/observability/spanProcessor.d.ts +129 -0
- package/dist/lib/observability/spanProcessor.js +288 -0
- package/dist/lib/observability/tokenTracker.d.ts +156 -0
- package/dist/lib/observability/tokenTracker.js +414 -0
- package/dist/lib/observability/types/exporterTypes.d.ts +250 -0
- package/dist/lib/observability/types/exporterTypes.js +6 -0
- package/dist/lib/observability/types/index.d.ts +6 -0
- package/dist/lib/observability/types/index.js +5 -0
- package/dist/lib/observability/types/spanTypes.d.ts +244 -0
- package/dist/lib/observability/types/spanTypes.js +93 -0
- package/dist/lib/observability/utils/index.d.ts +4 -0
- package/dist/lib/observability/utils/index.js +5 -0
- package/dist/lib/observability/utils/spanSerializer.d.ts +115 -0
- package/dist/lib/observability/utils/spanSerializer.js +287 -0
- package/dist/lib/providers/amazonSagemaker.d.ts +5 -4
- package/dist/lib/providers/amazonSagemaker.js +3 -4
- package/dist/lib/providers/googleVertex.d.ts +7 -0
- package/dist/lib/providers/googleVertex.js +80 -2
- package/dist/lib/rag/pipeline/RAGPipeline.d.ts +0 -5
- package/dist/lib/rag/pipeline/RAGPipeline.js +122 -87
- package/dist/lib/rag/ragIntegration.js +30 -0
- package/dist/lib/rag/retrieval/hybridSearch.js +22 -0
- package/dist/lib/server/abstract/baseServerAdapter.js +51 -19
- package/dist/lib/server/middleware/common.js +44 -12
- package/dist/lib/services/server/ai/observability/instrumentation.d.ts +2 -2
- package/dist/lib/services/server/ai/observability/instrumentation.js +10 -5
- package/dist/lib/types/conversationMemoryInterface.d.ts +2 -0
- package/dist/lib/types/modelTypes.d.ts +18 -18
- package/dist/lib/types/providers.d.ts +5 -0
- package/dist/lib/utils/pricing.js +25 -1
- package/dist/lib/utils/ttsProcessor.js +74 -59
- package/dist/lib/workflow/config.d.ts +36 -36
- package/dist/lib/workflow/core/ensembleExecutor.js +10 -0
- package/dist/lib/workflow/core/judgeScorer.js +20 -2
- package/dist/lib/workflow/core/workflowRunner.js +34 -1
- package/dist/mcp/httpRateLimiter.js +39 -12
- package/dist/mcp/httpRetryHandler.js +22 -1
- package/dist/mcp/mcpClientFactory.js +13 -15
- package/dist/memory/memoryRetrievalTools.js +22 -0
- package/dist/neurolink.d.ts +64 -72
- package/dist/neurolink.js +984 -566
- package/dist/observability/FEATURE-STATUS.md +269 -0
- package/dist/observability/exporterRegistry.d.ts +152 -0
- package/dist/observability/exporterRegistry.js +413 -0
- package/dist/observability/exporters/arizeExporter.d.ts +32 -0
- package/dist/observability/exporters/arizeExporter.js +138 -0
- package/dist/observability/exporters/baseExporter.d.ts +117 -0
- package/dist/observability/exporters/baseExporter.js +190 -0
- package/dist/observability/exporters/braintrustExporter.d.ts +30 -0
- package/dist/observability/exporters/braintrustExporter.js +154 -0
- package/dist/observability/exporters/datadogExporter.d.ts +37 -0
- package/dist/observability/exporters/datadogExporter.js +196 -0
- package/dist/observability/exporters/index.d.ts +13 -0
- package/dist/observability/exporters/index.js +13 -0
- package/dist/observability/exporters/laminarExporter.d.ts +48 -0
- package/dist/observability/exporters/laminarExporter.js +302 -0
- package/dist/observability/exporters/langfuseExporter.d.ts +47 -0
- package/dist/observability/exporters/langfuseExporter.js +199 -0
- package/dist/observability/exporters/langsmithExporter.d.ts +26 -0
- package/dist/observability/exporters/langsmithExporter.js +123 -0
- package/dist/observability/exporters/otelExporter.d.ts +39 -0
- package/dist/observability/exporters/otelExporter.js +164 -0
- package/dist/observability/exporters/posthogExporter.d.ts +48 -0
- package/dist/observability/exporters/posthogExporter.js +287 -0
- package/dist/observability/exporters/sentryExporter.d.ts +32 -0
- package/dist/observability/exporters/sentryExporter.js +165 -0
- package/dist/observability/index.d.ts +25 -0
- package/dist/observability/index.js +31 -0
- package/dist/observability/metricsAggregator.d.ts +260 -0
- package/dist/observability/metricsAggregator.js +552 -0
- package/dist/observability/otelBridge.d.ts +49 -0
- package/dist/observability/otelBridge.js +131 -0
- package/dist/observability/retryPolicy.d.ts +192 -0
- package/dist/observability/retryPolicy.js +383 -0
- package/dist/observability/sampling/index.d.ts +4 -0
- package/dist/observability/sampling/index.js +4 -0
- package/dist/observability/sampling/samplers.d.ts +116 -0
- package/dist/observability/sampling/samplers.js +216 -0
- package/dist/observability/spanProcessor.d.ts +129 -0
- package/dist/observability/spanProcessor.js +287 -0
- package/dist/observability/tokenTracker.d.ts +156 -0
- package/dist/observability/tokenTracker.js +413 -0
- package/dist/observability/types/exporterTypes.d.ts +250 -0
- package/dist/observability/types/exporterTypes.js +5 -0
- package/dist/observability/types/index.d.ts +6 -0
- package/dist/observability/types/index.js +4 -0
- package/dist/observability/types/spanTypes.d.ts +244 -0
- package/dist/observability/types/spanTypes.js +92 -0
- package/dist/observability/utils/index.d.ts +4 -0
- package/dist/observability/utils/index.js +4 -0
- package/dist/observability/utils/spanSerializer.d.ts +115 -0
- package/dist/observability/utils/spanSerializer.js +286 -0
- package/dist/providers/amazonSagemaker.d.ts +5 -4
- package/dist/providers/amazonSagemaker.js +3 -4
- package/dist/providers/googleVertex.d.ts +7 -0
- package/dist/providers/googleVertex.js +80 -2
- package/dist/rag/pipeline/RAGPipeline.d.ts +0 -5
- package/dist/rag/pipeline/RAGPipeline.js +122 -87
- package/dist/rag/ragIntegration.js +30 -0
- package/dist/rag/retrieval/hybridSearch.js +22 -0
- package/dist/server/abstract/baseServerAdapter.js +51 -19
- package/dist/server/middleware/common.js +44 -12
- package/dist/services/server/ai/observability/instrumentation.d.ts +2 -2
- package/dist/services/server/ai/observability/instrumentation.js +10 -5
- package/dist/types/conversationMemoryInterface.d.ts +2 -0
- package/dist/types/providers.d.ts +5 -0
- package/dist/utils/pricing.js +25 -1
- package/dist/utils/ttsProcessor.js +74 -59
- package/dist/workflow/config.d.ts +52 -52
- package/dist/workflow/core/ensembleExecutor.js +10 -0
- package/dist/workflow/core/judgeScorer.js +20 -2
- package/dist/workflow/core/workflowRunner.js +34 -1
- package/package.json +1 -1
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Metrics Aggregator
|
|
3
|
+
* Comprehensive metrics aggregation with latency percentiles, token usage, and cost tracking
|
|
4
|
+
*/
|
|
5
|
+
import type { TokenUsageStats } from "./tokenTracker.js";
|
|
6
|
+
import { TokenTracker } from "./tokenTracker.js";
|
|
7
|
+
import type { SpanData } from "./types/spanTypes.js";
|
|
8
|
+
/**
|
|
9
|
+
* Latency statistics with percentile calculations
|
|
10
|
+
*/
|
|
11
|
+
export type LatencyStats = {
|
|
12
|
+
/** Minimum latency in milliseconds */
|
|
13
|
+
min: number;
|
|
14
|
+
/** Maximum latency in milliseconds */
|
|
15
|
+
max: number;
|
|
16
|
+
/** Mean/average latency in milliseconds */
|
|
17
|
+
mean: number;
|
|
18
|
+
/** Median latency (p50) in milliseconds */
|
|
19
|
+
median: number;
|
|
20
|
+
/** 50th percentile latency in milliseconds */
|
|
21
|
+
p50: number;
|
|
22
|
+
/** 75th percentile latency in milliseconds */
|
|
23
|
+
p75: number;
|
|
24
|
+
/** 90th percentile latency in milliseconds */
|
|
25
|
+
p90: number;
|
|
26
|
+
/** 95th percentile latency in milliseconds */
|
|
27
|
+
p95: number;
|
|
28
|
+
/** 99th percentile latency in milliseconds */
|
|
29
|
+
p99: number;
|
|
30
|
+
/** Standard deviation in milliseconds */
|
|
31
|
+
stdDev: number;
|
|
32
|
+
/** Total number of samples */
|
|
33
|
+
count: number;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Cost breakdown by provider
|
|
37
|
+
*/
|
|
38
|
+
export type ProviderCostStats = {
|
|
39
|
+
provider: string;
|
|
40
|
+
totalCost: number;
|
|
41
|
+
requestCount: number;
|
|
42
|
+
avgCostPerRequest: number;
|
|
43
|
+
inputCost: number;
|
|
44
|
+
outputCost: number;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Cost breakdown by model
|
|
48
|
+
*/
|
|
49
|
+
export type ModelCostStats = {
|
|
50
|
+
model: string;
|
|
51
|
+
provider: string;
|
|
52
|
+
totalCost: number;
|
|
53
|
+
requestCount: number;
|
|
54
|
+
avgCostPerRequest: number;
|
|
55
|
+
inputTokens: number;
|
|
56
|
+
outputTokens: number;
|
|
57
|
+
inputCost: number;
|
|
58
|
+
outputCost: number;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Time window statistics
|
|
62
|
+
*/
|
|
63
|
+
export type TimeWindowStats = {
|
|
64
|
+
windowStart: Date;
|
|
65
|
+
windowEnd: Date;
|
|
66
|
+
windowDurationMs: number;
|
|
67
|
+
requestCount: number;
|
|
68
|
+
errorCount: number;
|
|
69
|
+
successRate: number;
|
|
70
|
+
throughput: number;
|
|
71
|
+
latency: LatencyStats;
|
|
72
|
+
tokens: TokenUsageStats;
|
|
73
|
+
costByProvider: Map<string, ProviderCostStats>;
|
|
74
|
+
costByModel: Map<string, ModelCostStats>;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Aggregated metrics summary
|
|
78
|
+
*/
|
|
79
|
+
export type MetricsSummary = {
|
|
80
|
+
/** Total number of spans tracked */
|
|
81
|
+
totalSpans: number;
|
|
82
|
+
/** Number of successful spans */
|
|
83
|
+
successfulSpans: number;
|
|
84
|
+
/** Number of failed spans */
|
|
85
|
+
failedSpans: number;
|
|
86
|
+
/** Overall success rate (0-1) */
|
|
87
|
+
successRate: number;
|
|
88
|
+
/** Latency statistics */
|
|
89
|
+
latency: LatencyStats;
|
|
90
|
+
/** Token usage statistics */
|
|
91
|
+
tokens: TokenUsageStats;
|
|
92
|
+
/** Cost by provider */
|
|
93
|
+
costByProvider: ProviderCostStats[];
|
|
94
|
+
/** Cost by model */
|
|
95
|
+
costByModel: ModelCostStats[];
|
|
96
|
+
/** Total cost across all providers */
|
|
97
|
+
totalCost: number;
|
|
98
|
+
/** Span count by type */
|
|
99
|
+
spansByType: Record<string, number>;
|
|
100
|
+
/** Timestamp of first span */
|
|
101
|
+
firstSpanTime?: Date;
|
|
102
|
+
/** Timestamp of last span */
|
|
103
|
+
lastSpanTime?: Date;
|
|
104
|
+
/** Tracking duration in milliseconds */
|
|
105
|
+
trackingDurationMs?: number;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Hierarchical trace view grouping related spans
|
|
109
|
+
*/
|
|
110
|
+
export type TraceView = {
|
|
111
|
+
/** Trace identifier shared by all spans in this trace */
|
|
112
|
+
traceId: string;
|
|
113
|
+
/** The root/parent span of this trace */
|
|
114
|
+
rootSpan: SpanData;
|
|
115
|
+
/** Child spans linked to the root */
|
|
116
|
+
childSpans: SpanData[];
|
|
117
|
+
/** Total duration from first to last span */
|
|
118
|
+
totalDurationMs: number;
|
|
119
|
+
/** Total number of spans in this trace */
|
|
120
|
+
spanCount: number;
|
|
121
|
+
/** Overall trace status */
|
|
122
|
+
status: "ok" | "error" | "partial";
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Configuration for the metrics aggregator
|
|
126
|
+
*/
|
|
127
|
+
export type MetricsAggregatorConfig = {
|
|
128
|
+
/** Maximum spans to retain in memory */
|
|
129
|
+
maxSpansRetained?: number;
|
|
130
|
+
/** Enable time-window statistics */
|
|
131
|
+
enableTimeWindows?: boolean;
|
|
132
|
+
/** Time window size in milliseconds (default: 60000 = 1 minute) */
|
|
133
|
+
timeWindowMs?: number;
|
|
134
|
+
/** Maximum time windows to retain */
|
|
135
|
+
maxTimeWindows?: number;
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Metrics Aggregator for comprehensive telemetry analysis
|
|
139
|
+
* Provides latency percentiles, token aggregation, and cost tracking
|
|
140
|
+
*/
|
|
141
|
+
export declare class MetricsAggregator {
|
|
142
|
+
private spans;
|
|
143
|
+
private latencyValues;
|
|
144
|
+
private tokenTracker;
|
|
145
|
+
private timeWindows;
|
|
146
|
+
private config;
|
|
147
|
+
private spansByType;
|
|
148
|
+
private costByProvider;
|
|
149
|
+
private costByModel;
|
|
150
|
+
private successCount;
|
|
151
|
+
private failureCount;
|
|
152
|
+
private firstSpanTime?;
|
|
153
|
+
private lastSpanTime?;
|
|
154
|
+
constructor(config?: MetricsAggregatorConfig);
|
|
155
|
+
/**
|
|
156
|
+
* Record a span for metrics aggregation
|
|
157
|
+
*/
|
|
158
|
+
recordSpan(span: SpanData): void;
|
|
159
|
+
/**
|
|
160
|
+
* Track cost aggregations from a span
|
|
161
|
+
*/
|
|
162
|
+
private trackCosts;
|
|
163
|
+
/**
|
|
164
|
+
* Update time window statistics
|
|
165
|
+
*/
|
|
166
|
+
private updateTimeWindow;
|
|
167
|
+
/**
|
|
168
|
+
* Create an empty time window
|
|
169
|
+
*/
|
|
170
|
+
private createEmptyTimeWindow;
|
|
171
|
+
/**
|
|
172
|
+
* Create empty latency stats
|
|
173
|
+
*/
|
|
174
|
+
private createEmptyLatencyStats;
|
|
175
|
+
/**
|
|
176
|
+
* Calculate latency percentile from sorted array
|
|
177
|
+
*/
|
|
178
|
+
private calculatePercentile;
|
|
179
|
+
/**
|
|
180
|
+
* Calculate standard deviation
|
|
181
|
+
*/
|
|
182
|
+
private calculateStdDev;
|
|
183
|
+
/**
|
|
184
|
+
* Get comprehensive latency statistics
|
|
185
|
+
*/
|
|
186
|
+
getLatencyStats(): LatencyStats;
|
|
187
|
+
/**
|
|
188
|
+
* Get token usage statistics
|
|
189
|
+
*/
|
|
190
|
+
getTokenStats(): TokenUsageStats;
|
|
191
|
+
/**
|
|
192
|
+
* Get cost breakdown by provider
|
|
193
|
+
*/
|
|
194
|
+
getCostByProvider(): ProviderCostStats[];
|
|
195
|
+
/**
|
|
196
|
+
* Get cost breakdown by model
|
|
197
|
+
*/
|
|
198
|
+
getCostByModel(): ModelCostStats[];
|
|
199
|
+
/**
|
|
200
|
+
* Get total cost across all providers
|
|
201
|
+
*/
|
|
202
|
+
getTotalCost(): number;
|
|
203
|
+
/**
|
|
204
|
+
* Get time window statistics
|
|
205
|
+
*/
|
|
206
|
+
getTimeWindows(): TimeWindowStats[];
|
|
207
|
+
/**
|
|
208
|
+
* Get statistics for a specific time range
|
|
209
|
+
*/
|
|
210
|
+
getStatsForTimeRange(startTime: Date, endTime: Date): TimeWindowStats;
|
|
211
|
+
/**
|
|
212
|
+
* Record a latency measurement for an operation
|
|
213
|
+
* Use this for standalone latency tracking without a full span
|
|
214
|
+
*/
|
|
215
|
+
recordLatency(operation: string, latencyMs: number): void;
|
|
216
|
+
/**
|
|
217
|
+
* Get comprehensive metrics summary (alias for getSummary)
|
|
218
|
+
*/
|
|
219
|
+
getMetrics(): MetricsSummary;
|
|
220
|
+
/**
|
|
221
|
+
* Get comprehensive metrics summary
|
|
222
|
+
*/
|
|
223
|
+
getSummary(): MetricsSummary;
|
|
224
|
+
/**
|
|
225
|
+
* Get all recorded spans (returns a copy)
|
|
226
|
+
*/
|
|
227
|
+
getSpans(): SpanData[];
|
|
228
|
+
/**
|
|
229
|
+
* Get spans grouped by traceId as hierarchical trace views
|
|
230
|
+
*/
|
|
231
|
+
getTraces(): TraceView[];
|
|
232
|
+
/**
|
|
233
|
+
* Get the underlying token tracker for custom pricing configuration
|
|
234
|
+
*/
|
|
235
|
+
getTokenTracker(): TokenTracker;
|
|
236
|
+
/**
|
|
237
|
+
* Reset all metrics
|
|
238
|
+
*/
|
|
239
|
+
reset(): void;
|
|
240
|
+
/**
|
|
241
|
+
* Export metrics as JSON
|
|
242
|
+
*/
|
|
243
|
+
toJSON(): Record<string, unknown>;
|
|
244
|
+
/**
|
|
245
|
+
* Format cost as currency string
|
|
246
|
+
*/
|
|
247
|
+
formatCost(cost: number, currency?: string): string;
|
|
248
|
+
/**
|
|
249
|
+
* Get a formatted summary string
|
|
250
|
+
*/
|
|
251
|
+
getFormattedSummary(): string;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Get the global metrics aggregator instance
|
|
255
|
+
*/
|
|
256
|
+
export declare function getMetricsAggregator(): MetricsAggregator;
|
|
257
|
+
/**
|
|
258
|
+
* Reset the global metrics aggregator (for testing)
|
|
259
|
+
*/
|
|
260
|
+
export declare function resetMetricsAggregator(): void;
|