@revenium/perplexity 2.0.8 → 2.0.9
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/.env.example +14 -1
- package/CHANGELOG.md +17 -0
- package/README.md +157 -37
- package/dist/cjs/core/config/loader.js +16 -0
- package/dist/cjs/core/config/loader.js.map +1 -1
- package/dist/cjs/core/config/manager.js +9 -0
- package/dist/cjs/core/config/manager.js.map +1 -1
- package/dist/cjs/core/tracking/api-client.js +2 -0
- package/dist/cjs/core/tracking/api-client.js.map +1 -1
- package/dist/cjs/core/tracking/payload-builder.js +20 -1
- package/dist/cjs/core/tracking/payload-builder.js.map +1 -1
- package/dist/cjs/core/tracking/usage-tracker.js +1 -1
- package/dist/cjs/core/tracking/usage-tracker.js.map +1 -1
- package/dist/cjs/utils/summary-printer.js +237 -0
- package/dist/cjs/utils/summary-printer.js.map +1 -0
- package/dist/cjs/utils/trace-fields.js +136 -0
- package/dist/cjs/utils/trace-fields.js.map +1 -0
- package/dist/esm/core/config/loader.js +16 -0
- package/dist/esm/core/config/loader.js.map +1 -1
- package/dist/esm/core/config/manager.js +9 -0
- package/dist/esm/core/config/manager.js.map +1 -1
- package/dist/esm/core/tracking/api-client.js +2 -0
- package/dist/esm/core/tracking/api-client.js.map +1 -1
- package/dist/esm/core/tracking/payload-builder.js +20 -1
- package/dist/esm/core/tracking/payload-builder.js.map +1 -1
- package/dist/esm/core/tracking/usage-tracker.js +1 -1
- package/dist/esm/core/tracking/usage-tracker.js.map +1 -1
- package/dist/esm/utils/summary-printer.js +233 -0
- package/dist/esm/utils/summary-printer.js.map +1 -0
- package/dist/esm/utils/trace-fields.js +121 -0
- package/dist/esm/utils/trace-fields.js.map +1 -0
- package/dist/types/core/config/loader.d.ts.map +1 -1
- package/dist/types/core/config/manager.d.ts.map +1 -1
- package/dist/types/core/tracking/api-client.d.ts.map +1 -1
- package/dist/types/core/tracking/payload-builder.d.ts +1 -1
- package/dist/types/core/tracking/payload-builder.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +13 -0
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/utils/summary-printer.d.ts +23 -0
- package/dist/types/utils/summary-printer.d.ts.map +1 -0
- package/dist/types/utils/trace-fields.d.ts +11 -0
- package/dist/types/utils/trace-fields.d.ts.map +1 -0
- package/package.json +4 -2
package/.env.example
CHANGED
|
@@ -6,5 +6,18 @@ REVENIUM_METERING_BASE_URL=https://api.revenium.ai
|
|
|
6
6
|
PERPLEXITY_API_KEY=pplx_your_perplexity_api_key_here
|
|
7
7
|
PERPLEXITY_API_BASE_URL=https://api.perplexity.ai
|
|
8
8
|
|
|
9
|
+
# Trace Visualization Fields (Optional)
|
|
10
|
+
REVENIUM_ENVIRONMENT=production
|
|
11
|
+
REVENIUM_REGION=us-east-1
|
|
12
|
+
REVENIUM_CREDENTIAL_ALIAS=Perplexity Production Key
|
|
13
|
+
REVENIUM_TRACE_TYPE=customer_support
|
|
14
|
+
REVENIUM_TRACE_NAME=Support Ticket #12345
|
|
15
|
+
REVENIUM_PARENT_TRANSACTION_ID=parent-txn-123
|
|
16
|
+
REVENIUM_TRANSACTION_NAME=Answer Customer Question
|
|
17
|
+
REVENIUM_RETRY_NUMBER=0
|
|
18
|
+
|
|
9
19
|
# Debug Configuration (Optional)
|
|
10
|
-
REVENIUM_DEBUG=false
|
|
20
|
+
REVENIUM_DEBUG=false
|
|
21
|
+
|
|
22
|
+
# AWS Region Detection (Optional - auto-detected if not set)
|
|
23
|
+
AWS_REGION=us-east-1
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.0.9] - 2026-01-06
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Trace visualization fields support for distributed tracing and analytics
|
|
13
|
+
- New trace fields: environment, region, credentialAlias, traceType, traceName, parentTransactionId, transactionName, retryNumber, operationSubtype
|
|
14
|
+
- Automatic region detection from AWS/Azure/GCP environment variables with fallback to AWS EC2 metadata service
|
|
15
|
+
- Comprehensive unit tests for all trace field functions
|
|
16
|
+
- Jest testing infrastructure with full test coverage
|
|
17
|
+
- Updated .env.example with trace visualization field examples
|
|
18
|
+
- Documentation for trace visualization fields in README.md
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- buildPayload function is now async to support region detection
|
|
23
|
+
- Updated ReveniumPayload interface with trace visualization fields
|
|
24
|
+
|
|
8
25
|
## [2.0.8] - 2025-11-14
|
|
9
26
|
|
|
10
27
|
### Changed
|
package/README.md
CHANGED
|
@@ -84,6 +84,10 @@ REVENIUM_METERING_API_KEY=hak_your_revenium_api_key
|
|
|
84
84
|
|
|
85
85
|
# Optional: Enable debug logging
|
|
86
86
|
# REVENIUM_DEBUG=false
|
|
87
|
+
|
|
88
|
+
# Optional: Terminal cost/metrics summary
|
|
89
|
+
# REVENIUM_PRINT_SUMMARY=true # or 'human' or 'json'
|
|
90
|
+
# REVENIUM_TEAM_ID=your_team_id # Required for cost retrieval
|
|
87
91
|
```
|
|
88
92
|
|
|
89
93
|
**Replace the placeholder values with your actual keys!**
|
|
@@ -200,53 +204,169 @@ The middleware automatically captures comprehensive usage data:
|
|
|
200
204
|
|
|
201
205
|
The following table shows all fields this middleware sends to the Revenium API:
|
|
202
206
|
|
|
203
|
-
| Field
|
|
204
|
-
|
|
205
|
-
| **Core Fields**
|
|
206
|
-
| `model`
|
|
207
|
-
| `provider`
|
|
208
|
-
| `inputTokenCount`
|
|
209
|
-
| `outputTokenCount`
|
|
210
|
-
| `totalTokenCount`
|
|
211
|
-
| `requestDuration`
|
|
212
|
-
| **Timing**
|
|
213
|
-
| `requestTime`
|
|
214
|
-
| `responseTime`
|
|
215
|
-
| `completionStartTime`
|
|
216
|
-
| `timeToFirstToken`
|
|
217
|
-
| **Request Details**
|
|
218
|
-
| `transactionId`
|
|
219
|
-
| `operationType`
|
|
220
|
-
| `stopReason`
|
|
221
|
-
| `isStreamed`
|
|
222
|
-
| `costType`
|
|
223
|
-
| `modelSource`
|
|
224
|
-
| `middlewareSource`
|
|
225
|
-
| **Cost Information**
|
|
226
|
-
| `inputTokenCost`
|
|
227
|
-
| `outputTokenCost`
|
|
228
|
-
| `totalCost`
|
|
229
|
-
| **Business Context**
|
|
230
|
-
| `organizationId`
|
|
231
|
-
| `productId`
|
|
232
|
-
| `subscriptionId`
|
|
233
|
-
| `taskType`
|
|
234
|
-
| `traceId`
|
|
235
|
-
| `agent`
|
|
236
|
-
| `responseQualityScore`
|
|
237
|
-
| `subscriber.id`
|
|
238
|
-
| `subscriber.email`
|
|
239
|
-
| `subscriber.credential` | object
|
|
207
|
+
| Field | Type | Required | Description |
|
|
208
|
+
| ----------------------- | ------- | --------- | -------------------------------------------------- |
|
|
209
|
+
| **Core Fields** | | | |
|
|
210
|
+
| `model` | string | Yes | Perplexity model name (e.g., "sonar-pro") |
|
|
211
|
+
| `provider` | string | Yes | Always "Perplexity" |
|
|
212
|
+
| `inputTokenCount` | integer | Yes | Number of input tokens consumed |
|
|
213
|
+
| `outputTokenCount` | integer | Yes | Number of output tokens generated |
|
|
214
|
+
| `totalTokenCount` | integer | Yes | Total tokens (input + output) |
|
|
215
|
+
| `requestDuration` | integer | Yes | Request duration in milliseconds |
|
|
216
|
+
| **Timing** | | | |
|
|
217
|
+
| `requestTime` | string | Auto | ISO 8601 timestamp when request started |
|
|
218
|
+
| `responseTime` | string | Auto | ISO 8601 timestamp when response completed |
|
|
219
|
+
| `completionStartTime` | string | Auto | ISO 8601 timestamp when completion started |
|
|
220
|
+
| `timeToFirstToken` | integer | Streaming | Time to first token in ms (streaming only) |
|
|
221
|
+
| **Request Details** | | | |
|
|
222
|
+
| `transactionId` | string | Auto | Unique transaction identifier |
|
|
223
|
+
| `operationType` | string | Auto | Always "CHAT" for chat completions |
|
|
224
|
+
| `stopReason` | string | Auto | Completion finish reason ("END", "STOP", etc.) |
|
|
225
|
+
| `isStreamed` | boolean | Auto | Whether response was streamed |
|
|
226
|
+
| `costType` | string | Auto | Always "AI" |
|
|
227
|
+
| `modelSource` | string | Auto | Always "PERPLEXITY" |
|
|
228
|
+
| `middlewareSource` | string | Auto | Always "revenium-perplexity-node" |
|
|
229
|
+
| **Cost Information** | | | |
|
|
230
|
+
| `inputTokenCost` | number | Optional | Cost for input tokens (if provided by Perplexity) |
|
|
231
|
+
| `outputTokenCost` | number | Optional | Cost for output tokens (if provided by Perplexity) |
|
|
232
|
+
| `totalCost` | number | Optional | Total cost (if provided by Perplexity) |
|
|
233
|
+
| **Business Context** | | | |
|
|
234
|
+
| `organizationId` | string | Optional | Your organization identifier |
|
|
235
|
+
| `productId` | string | Optional | Your product identifier |
|
|
236
|
+
| `subscriptionId` | string | Optional | Your subscription identifier |
|
|
237
|
+
| `taskType` | string | Optional | Type of AI task (e.g., "chat", "research") |
|
|
238
|
+
| `traceId` | string | Optional | Session or conversation tracking ID |
|
|
239
|
+
| `agent` | string | Optional | AI agent or bot identifier |
|
|
240
|
+
| `responseQualityScore` | number | Optional | Custom quality rating (0.0-1.0) |
|
|
241
|
+
| `subscriber.id` | string | Optional | User identifier |
|
|
242
|
+
| `subscriber.email` | string | Optional | User email address |
|
|
243
|
+
| `subscriber.credential` | object | Optional | Authentication credential (name, value) |
|
|
240
244
|
|
|
241
245
|
**Notes:**
|
|
246
|
+
|
|
242
247
|
- **Required** fields are always sent with every request
|
|
243
248
|
- **Auto** fields are automatically populated by the middleware
|
|
244
249
|
- **Optional** fields are only sent if you provide them via `usageMetadata`
|
|
245
250
|
- **Streaming** fields are only sent for streaming requests
|
|
246
251
|
|
|
247
252
|
**Reference:**
|
|
253
|
+
|
|
248
254
|
- [API Reference](https://revenium.readme.io/reference/meter_ai_completion) - Complete metadata field documentation
|
|
249
255
|
|
|
256
|
+
## Trace Visualization Fields
|
|
257
|
+
|
|
258
|
+
The middleware automatically captures trace visualization fields for distributed tracing and analytics:
|
|
259
|
+
|
|
260
|
+
| Field | Type | Description | Environment Variable |
|
|
261
|
+
| --------------------- | ------ | ------------------------------------------------------------------------------- | ---------------------------------- |
|
|
262
|
+
| `environment` | string | Deployment environment (production, staging, development) | `REVENIUM_ENVIRONMENT`, `NODE_ENV` |
|
|
263
|
+
| `operationType` | string | Operation classification (CHAT, EMBED, etc.) - automatically detected | N/A (auto-detected) |
|
|
264
|
+
| `operationSubtype` | string | Additional detail (function_call, etc.) - automatically detected | N/A (auto-detected) |
|
|
265
|
+
| `retryNumber` | number | Retry attempt number (0 for first attempt, 1+ for retries) | `REVENIUM_RETRY_NUMBER` |
|
|
266
|
+
| `parentTransactionId` | string | Parent transaction reference for distributed tracing | `REVENIUM_PARENT_TRANSACTION_ID` |
|
|
267
|
+
| `transactionName` | string | Human-friendly operation label | `REVENIUM_TRANSACTION_NAME` |
|
|
268
|
+
| `region` | string | Cloud region (us-east-1, etc.) - auto-detected from AWS/Azure/GCP | `AWS_REGION`, `REVENIUM_REGION` |
|
|
269
|
+
| `credentialAlias` | string | Human-readable credential name | `REVENIUM_CREDENTIAL_ALIAS` |
|
|
270
|
+
| `traceType` | string | Categorical identifier (alphanumeric, hyphens, underscores only, max 128 chars) | `REVENIUM_TRACE_TYPE` |
|
|
271
|
+
| `traceName` | string | Human-readable label for trace instances (max 256 chars) | `REVENIUM_TRACE_NAME` |
|
|
272
|
+
|
|
273
|
+
**All trace visualization fields are optional.** The middleware will automatically detect and populate these fields when possible.
|
|
274
|
+
|
|
275
|
+
### Example Configuration
|
|
276
|
+
|
|
277
|
+
```env
|
|
278
|
+
REVENIUM_ENVIRONMENT=production
|
|
279
|
+
REVENIUM_REGION=us-east-1
|
|
280
|
+
REVENIUM_CREDENTIAL_ALIAS=Perplexity Production Key
|
|
281
|
+
REVENIUM_TRACE_TYPE=customer_support
|
|
282
|
+
REVENIUM_TRACE_NAME=Support Ticket #12345
|
|
283
|
+
REVENIUM_PARENT_TRANSACTION_ID=parent-txn-123
|
|
284
|
+
REVENIUM_TRANSACTION_NAME=Answer Customer Question
|
|
285
|
+
REVENIUM_RETRY_NUMBER=0
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
For a complete example, see [`.env.example`](https://github.com/revenium/revenium-middleware-perplexity-node/blob/HEAD/.env.example).
|
|
289
|
+
|
|
290
|
+
## Terminal Cost/Metrics Summary
|
|
291
|
+
|
|
292
|
+
The middleware can print a cost and metrics summary to your terminal after each API request. This is useful for development and debugging.
|
|
293
|
+
|
|
294
|
+
### Configuration
|
|
295
|
+
|
|
296
|
+
Enable terminal summary output using environment variables or programmatic configuration:
|
|
297
|
+
|
|
298
|
+
**Environment Variables:**
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
# Enable human-readable summary (default format)
|
|
302
|
+
export REVENIUM_PRINT_SUMMARY=true
|
|
303
|
+
|
|
304
|
+
# Or specify format explicitly
|
|
305
|
+
export REVENIUM_PRINT_SUMMARY=human # Human-readable format
|
|
306
|
+
export REVENIUM_PRINT_SUMMARY=json # JSON format for log parsing
|
|
307
|
+
|
|
308
|
+
# Optional: Set team ID to fetch cost data
|
|
309
|
+
export REVENIUM_TEAM_ID=your_team_id
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
**Programmatic Configuration:**
|
|
313
|
+
|
|
314
|
+
```typescript
|
|
315
|
+
import { Initialize } from "@revenium/perplexity";
|
|
316
|
+
|
|
317
|
+
Initialize({
|
|
318
|
+
reveniumApiKey: "hak_your_api_key",
|
|
319
|
+
reveniumBaseUrl: "https://api.revenium.ai",
|
|
320
|
+
perplexityApiKey: "pplx_your_api_key",
|
|
321
|
+
printSummary: true, // or 'human' or 'json'
|
|
322
|
+
teamId: "your_team_id", // Optional: for cost retrieval
|
|
323
|
+
});
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### Output Formats
|
|
327
|
+
|
|
328
|
+
**Human-readable format** (`printSummary: true` or `printSummary: 'human'`):
|
|
329
|
+
|
|
330
|
+
```
|
|
331
|
+
============================================================
|
|
332
|
+
📊 REVENIUM USAGE SUMMARY
|
|
333
|
+
============================================================
|
|
334
|
+
🤖 Model: sonar-pro
|
|
335
|
+
🏢 Provider: Perplexity
|
|
336
|
+
⏱️ Duration: 1.23s
|
|
337
|
+
|
|
338
|
+
💬 Token Usage:
|
|
339
|
+
📥 Input Tokens: 150
|
|
340
|
+
📤 Output Tokens: 75
|
|
341
|
+
📊 Total Tokens: 225
|
|
342
|
+
|
|
343
|
+
💰 Cost: $0.004500
|
|
344
|
+
🔖 Trace ID: trace-abc-123
|
|
345
|
+
============================================================
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
**JSON format** (`printSummary: 'json'`):
|
|
349
|
+
|
|
350
|
+
```json
|
|
351
|
+
{
|
|
352
|
+
"model": "sonar-pro",
|
|
353
|
+
"provider": "Perplexity",
|
|
354
|
+
"durationSeconds": 1.23,
|
|
355
|
+
"inputTokenCount": 150,
|
|
356
|
+
"outputTokenCount": 75,
|
|
357
|
+
"totalTokenCount": 225,
|
|
358
|
+
"cost": 0.0045,
|
|
359
|
+
"traceId": "trace-abc-123"
|
|
360
|
+
}
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
### Cost Retrieval
|
|
364
|
+
|
|
365
|
+
- **Without `teamId`**: Shows token counts and duration, displays hint to set `REVENIUM_TEAM_ID`
|
|
366
|
+
- **With `teamId`**: Fetches actual cost from Revenium API with automatic retry logic
|
|
367
|
+
- **Cost pending**: Shows "(pending aggregation)" if cost data isn't available yet
|
|
368
|
+
- **Fire-and-forget**: Never blocks your application, even if cost fetch fails
|
|
369
|
+
|
|
250
370
|
## API Overview
|
|
251
371
|
|
|
252
372
|
- **`Initialize(config?)`** - Initialize the middleware (from environment or explicit config)
|
|
@@ -33,6 +33,20 @@ function loadConfigFromEnv() {
|
|
|
33
33
|
const perplexityApiKey = process.env.PERPLEXITY_API_KEY;
|
|
34
34
|
const perplexityBaseUrl = process.env.PERPLEXITY_API_BASE_URL || DEFAULT_PERPLEXITY_BASE_URL;
|
|
35
35
|
const debug = process.env.REVENIUM_DEBUG === "true";
|
|
36
|
+
let printSummary = undefined;
|
|
37
|
+
const printSummaryEnv = process.env.REVENIUM_PRINT_SUMMARY;
|
|
38
|
+
if (printSummaryEnv) {
|
|
39
|
+
if (printSummaryEnv === "true") {
|
|
40
|
+
printSummary = true;
|
|
41
|
+
}
|
|
42
|
+
else if (printSummaryEnv === "false") {
|
|
43
|
+
printSummary = false;
|
|
44
|
+
}
|
|
45
|
+
else if (printSummaryEnv === "human" || printSummaryEnv === "json") {
|
|
46
|
+
printSummary = printSummaryEnv;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const teamId = process.env.REVENIUM_TEAM_ID;
|
|
36
50
|
if (!reveniumApiKey)
|
|
37
51
|
return null;
|
|
38
52
|
if (!perplexityApiKey)
|
|
@@ -43,6 +57,8 @@ function loadConfigFromEnv() {
|
|
|
43
57
|
perplexityApiKey,
|
|
44
58
|
perplexityBaseUrl,
|
|
45
59
|
debug,
|
|
60
|
+
printSummary,
|
|
61
|
+
teamId,
|
|
46
62
|
};
|
|
47
63
|
}
|
|
48
64
|
//# sourceMappingURL=loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../../../src/core/config/loader.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAoBH,
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../../../src/core/config/loader.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAoBH,8CA2CC;AA5DD,mCAA8C;AAE9C;;GAEG;AACH,MAAM,yBAAyB,GAAG,yBAAyB,CAAC;AAC5D,MAAM,2BAA2B,GAAG,2BAA2B,CAAC;AAEhE;;GAEG;AACH,IAAI,aAAa,GAAG,KAAK,CAAC;AAE1B;;;GA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Y;QACZ,MAAM;KACP,CAAC;AACJ,CAAC"}
|
|
@@ -12,6 +12,7 @@ exports.getLogger = getLogger;
|
|
|
12
12
|
exports.initializeConfig = initializeConfig;
|
|
13
13
|
const loader_js_1 = require("./loader.js");
|
|
14
14
|
const validator_js_1 = require("./validator.js");
|
|
15
|
+
const summary_printer_js_1 = require("../../utils/summary-printer.js");
|
|
15
16
|
/**
|
|
16
17
|
* Global configuration instance
|
|
17
18
|
*/
|
|
@@ -52,6 +53,14 @@ function setConfig(config) {
|
|
|
52
53
|
baseUrl: config.reveniumBaseUrl,
|
|
53
54
|
hasReveniumKey: !!config.reveniumApiKey,
|
|
54
55
|
hasPerplexityKey: !!config.perplexityApiKey,
|
|
56
|
+
printSummary: config.printSummary,
|
|
57
|
+
teamId: config.teamId,
|
|
58
|
+
});
|
|
59
|
+
(0, summary_printer_js_1.setConfig)({
|
|
60
|
+
reveniumApiKey: config.reveniumApiKey,
|
|
61
|
+
reveniumBaseUrl: config.reveniumBaseUrl,
|
|
62
|
+
teamId: config.teamId,
|
|
63
|
+
printSummary: config.printSummary,
|
|
55
64
|
});
|
|
56
65
|
}
|
|
57
66
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../../../src/core/config/manager.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;
|
|
1
|
+
{"version":3,"file":"manager.js","sourceRoot":"","sources":["../../../../src/core/config/manager.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAqCH,8BAEC;AAKD,8BAiBC;AAKD,8BAEC;AAKD,4CAkBC;AAxFD,2CAAgD;AAChD,iDAAgD;AAChD,uEAAsF;AAEtF;;GAEG;AACH,IAAI,YAAY,GAA0B,IAAI,CAAC;AAE/C;;GAEG;AACU,QAAA,aAAa,GAAW;IACnC,KAAK,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAE,EAAE;QAC7C,IAAI,YAAY,EAAE,KAAK,IAAI,OAAO,CA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AAM,CAAC,MAAM;QACrB,YAAY,EAAE,MAAM,CAAC,YAAY;KAClC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,SAAgB,SAAS;IACvB,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,SAAgB,gBAAgB;IAC9B,MAAM,SAAS,GAAG,IAAA,6BAAiB,GAAE,CAAC;IAEtC,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,YAAY,CAAC,KAAK,CAChB,iHAAiH,CAClH,CAAC;QACF,MAAM,IAAI,KAAK,CACb,iHAAiH,CAClH,CAAC;IACJ,CAAC;IAED,SAAS,CAAC,SAAS,CAAC,CAAC;IACrB,YAAY,CAAC,KAAK,CAChB,4DAA4D,CAC7D,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -9,6 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.sendToRevenium = sendToRevenium;
|
|
10
10
|
const config_1 = require("../config");
|
|
11
11
|
const url_builder_js_1 = require("../../utils/url-builder.js");
|
|
12
|
+
const summary_printer_js_1 = require("../../utils/summary-printer.js");
|
|
12
13
|
// Global logger
|
|
13
14
|
const logger = (0, config_1.getLogger)();
|
|
14
15
|
/**
|
|
@@ -63,5 +64,6 @@ async function sendToRevenium(payload) {
|
|
|
63
64
|
operationType: payload.operationType,
|
|
64
65
|
response: responseBody,
|
|
65
66
|
});
|
|
67
|
+
(0, summary_printer_js_1.printUsageSummary)(payload);
|
|
66
68
|
}
|
|
67
69
|
//# sourceMappingURL=api-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../../../../src/core/tracking/api-client.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;
|
|
1
|
+
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../../../../src/core/tracking/api-client.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAkBH,wCAyDC;AAxED,sCA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A6B,EAAE;YAC1C,MAAM,EAAE,QAAQ,CAAC,MAAM;YACvB,UAAU,EAAE,QAAQ,CAAC,UAAU;YAC/B,IAAI,EAAE,YAAY;YAClB,aAAa,EAAE,OAAO,CAAC,aAAa;YACpC,aAAa,EAAE,OAAO,CAAC,aAAa;SACrC,CAAC,CAAC;QACH,MAAM,IAAI,KAAK,CACb,uBAAuB,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,MAAM,YAAY,EAAE,CAClF,CAAC;IACJ,CAAC;IAED,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC3C,MAAM,CAAC,KAAK,CAAC,8BAA8B,EAAE;QAC3C,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,aAAa,EAAE,OAAO,CAAC,aAAa;QACpC,QAAQ,EAAE,YAAY;KACvB,CAAC,CAAC;IAEH,IAAA,sCAAiB,EAAC,OAAO,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -12,6 +12,7 @@ const index_js_1 = require("../config/index.js");
|
|
|
12
12
|
const stop_reason_mapper_js_1 = require("../../utils/stop-reason-mapper.js");
|
|
13
13
|
const metadata_builder_js_1 = require("../../utils/metadata-builder.js");
|
|
14
14
|
const index_js_2 = require("../providers/index.js");
|
|
15
|
+
const trace_fields_js_1 = require("../../utils/trace-fields.js");
|
|
15
16
|
// Global logger
|
|
16
17
|
const logger = (0, index_js_1.getLogger)();
|
|
17
18
|
/**
|
|
@@ -29,7 +30,7 @@ const logger = (0, index_js_1.getLogger)();
|
|
|
29
30
|
* @param timeToFirstToken - Time to first token in milliseconds (for streaming)
|
|
30
31
|
* @returns Constructed payload for Revenium API
|
|
31
32
|
*/
|
|
32
|
-
function buildPayload(operationType, response, request, startTime, duration, providerInfo, timeToFirstToken) {
|
|
33
|
+
async function buildPayload(operationType, response, request, startTime, duration, providerInfo, timeToFirstToken) {
|
|
33
34
|
const now = new Date().toISOString();
|
|
34
35
|
const requestTime = new Date(startTime).toISOString();
|
|
35
36
|
const usage = response.usage;
|
|
@@ -43,6 +44,15 @@ function buildPayload(operationType, response, request, startTime, duration, pro
|
|
|
43
44
|
: { provider: "Perplexity", modelSource: "PERPLEXITY" };
|
|
44
45
|
// Build metadata fields using utility (eliminates repetitive spreading)
|
|
45
46
|
const metadataFields = (0, metadata_builder_js_1.buildMetadataFields)(request.usageMetadata);
|
|
47
|
+
const environment = (0, trace_fields_js_1.getEnvironment)();
|
|
48
|
+
const region = await (0, trace_fields_js_1.getRegion)();
|
|
49
|
+
const credentialAlias = (0, trace_fields_js_1.getCredentialAlias)();
|
|
50
|
+
const traceType = (0, trace_fields_js_1.getTraceType)();
|
|
51
|
+
const traceName = (0, trace_fields_js_1.getTraceName)();
|
|
52
|
+
const parentTransactionId = (0, trace_fields_js_1.getParentTransactionId)();
|
|
53
|
+
const transactionName = (0, trace_fields_js_1.getTransactionName)();
|
|
54
|
+
const retryNumber = (0, trace_fields_js_1.getRetryNumber)();
|
|
55
|
+
const operationSubtype = (0, trace_fields_js_1.detectOperationSubtype)(request);
|
|
46
56
|
// Map Perplexity cost object to Revenium cost fields
|
|
47
57
|
const costFields = usage.cost
|
|
48
58
|
? {
|
|
@@ -71,6 +81,15 @@ function buildPayload(operationType, response, request, startTime, duration, pro
|
|
|
71
81
|
totalTokenCount: usage.total_tokens,
|
|
72
82
|
// Metadata fields (processed by utility)
|
|
73
83
|
...metadataFields,
|
|
84
|
+
environment: environment || undefined,
|
|
85
|
+
region: region || undefined,
|
|
86
|
+
credentialAlias: credentialAlias || undefined,
|
|
87
|
+
traceType: traceType || undefined,
|
|
88
|
+
traceName: traceName || undefined,
|
|
89
|
+
parentTransactionId: parentTransactionId || undefined,
|
|
90
|
+
transactionName: transactionName || undefined,
|
|
91
|
+
retryNumber: retryNumber !== null ? retryNumber : undefined,
|
|
92
|
+
operationSubtype: operationSubtype || undefined,
|
|
74
93
|
// Fixed middleware source identifier (spec format: revenium-{provider}-{language})
|
|
75
94
|
middlewareSource: "revenium-perplexity-node",
|
|
76
95
|
// Cost fields from Perplexity
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payload-builder.js","sourceRoot":"","sources":["../../../../src/core/tracking/payload-builder.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;
|
|
1
|
+
{"version":3,"file":"payload-builder.js","sourceRoot":"","sources":["../../../../src/core/tracking/payload-builder.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AA2CH,oCAqGC;AA9ID,mCAAoC;AAOpC,iDAA+C;AAC/C,6EAAkE;AAClE,yEAAsE;AACtE,oDAA4D;AAC5D,iEAUqC;AAErC,gBAAgB;AAChB,MAAM,MAAM,GAAG,IAAA,oBAAS,GAAE,CAAC;AAE3B;;;;;;;;;;;;;;GAcG;AACI,KAAK,UAAU,YAAY,CAChC,aAAqB,EACrB,QAA4B,EAC5B,OAA8B,EAC9B,SAAiB,EACjB,QAAgB,EAChB,YAA2B,EAC3B,gBAAyB;IAEzB,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACrC,MAAM,WAAW,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC;IACtD,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;IAE7B,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEjC,4CAA4C;IAC5C,MAAM,gBAAgB,GAAG,YAAY;QACnC,CAAC,CAAC,IAAA,8BAAmB,GAAE;QACvB,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;IAE1D,wEAAwE;IACxE,MAAM,cAAc,GAAG,IAAA,yCAAmB,EAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAElE,MAAM,WAAW,GAAG,IAAA,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AI,SAAS;QAC3B,eAAe,EAAE,eAAe,IAAI,SAAS;QAC7C,SAAS,EAAE,SAAS,IAAI,SAAS;QACjC,SAAS,EAAE,SAAS,IAAI,SAAS;QACjC,mBAAmB,EAAE,mBAAmB,IAAI,SAAS;QACrD,eAAe,EAAE,eAAe,IAAI,SAAS;QAC7C,WAAW,EAAE,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS;QAC3D,gBAAgB,EAAE,gBAAgB,IAAI,SAAS;QAE/C,mFAAmF;QACnF,gBAAgB,EAAE,0BAA0B;QAE5C,8BAA8B;QAC9B,GAAG,UAAU;KACd,CAAC;IAEF,uBAAuB;IACvB,OAAO;QACL,GAAG,aAAa;QAChB,aAAa,EAAE,MAAM;QACrB,aAAa,EAAE,QAAQ,CAAC,EAAE,IAAI,QAAQ,IAAA,mBAAU,GAAE,EAAE;QACpD,gBAAgB,EAAE,KAAK,CAAC,iBAAiB,IAAI,CAAC;QAC9C,kDAAkD;QAClD,mBAAmB,EAAE,SAAS;QAC9B,uBAAuB,EAAE,SAAS;QAClC,mBAAmB,EAAE,SAAS;QAC9B,UAAU,EAAE,IAAA,qCAAa,EAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC;QACvE,UAAU,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;QACnC,+CAA+C;QAC/C,gBAAgB,EAAE,gBAAgB;KACnC,CAAC;AACJ,CAAC"}
|
|
@@ -19,7 +19,7 @@ const logger = (0, index_js_1.getLogger)();
|
|
|
19
19
|
*/
|
|
20
20
|
async function sendReveniumMetrics(response, request, startTime, duration, providerInfo, timeToFirstToken) {
|
|
21
21
|
await (0, error_handler_js_1.safeAsyncOperation)(async () => {
|
|
22
|
-
const payload = (0, payload_builder_js_1.buildPayload)("CHAT", response, request, startTime, duration, providerInfo, timeToFirstToken);
|
|
22
|
+
const payload = await (0, payload_builder_js_1.buildPayload)("CHAT", response, request, startTime, duration, providerInfo, timeToFirstToken);
|
|
23
23
|
await (0, api_client_js_1.sendToRevenium)(payload);
|
|
24
24
|
}, "Chat completion tracking", {
|
|
25
25
|
logError: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage-tracker.js","sourceRoot":"","sources":["../../../../src/core/tracking/usage-tracker.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAoBH,kDA6BC;AAMD,0CAuEC;AArHD,iDAA+C;AAC/C,mDAAiD;AACjD,6DAAoD;AACpD,mEAAkE;AAElE,gBAAgB;AAChB,MAAM,MAAM,GAAG,IAAA,oBAAS,GAAE,CAAC;AAE3B;;GAEG;AACI,KAAK,UAAU,mBAAmB,CACvC,QAA4B,EAC5B,OAA8B,EAC9B,SAAiB,EACjB,QAAgB,EAChB,YAA2B,EAC3B,gBAAyB;IAEzB,MAAM,IAAA,qCAAkB,EACtB,KAAK,IAAI,EAAE;QACT,MAAM,OAAO,GAAG,IAAA,iCAAY,
|
|
1
|
+
{"version":3,"file":"usage-tracker.js","sourceRoot":"","sources":["../../../../src/core/tracking/usage-tracker.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAoBH,kDA6BC;AAMD,0CAuEC;AArHD,iDAA+C;AAC/C,mDAAiD;AACjD,6DAAoD;AACpD,mEAAkE;AAElE,gBAAgB;AAChB,MAAM,MAAM,GAAG,IAAA,oBAAS,GAAE,CAAC;AAE3B;;GAEG;AACI,KAAK,UAAU,mBAAmB,CACvC,QAA4B,EAC5B,OAA8B,EAC9B,SAAiB,EACjB,QAAgB,EAChB,YAA2B,EAC3B,gBAAyB;IAEzB,MAAM,IAAA,qCAAkB,EACtB,KAAK,IAAI,EAAE;QACT,MAAM,OAAO,GAAG,MAAM,IAAA,iCAAY,EAChC,MAAM,EACN,QAAQ,EACR,OAAO,EACP,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,gBAAgB,CACjB,CAAC;QACF,MAAM,IAAA,8BAAc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