Skip to content

Commit 6d769cf

Browse files
committed
playground logs export
Signed-off-by: Praneeth Bedapudi <praneeth@bpraneeth.com>
1 parent 86f4a99 commit 6d769cf

5 files changed

Lines changed: 1462 additions & 1 deletion

File tree

docs/playground/log-export.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
sidebar_position: 2
3+
hide_table_of_contents: true
4+
sidebar_custom_props:
5+
badge: new
6+
icon: ClipboardList
7+
---
8+
9+
# Log Export Playground
10+
11+
Export LLM Gateway or MCP Gateway logs into an Excel-compatible CSV without writing your own exporter first. Choose the gateway, time window, row limit, and columns, then run the Log Export API directly from this page.
12+
13+
:::caution Use export keys only
14+
This playground expects a Log Export key such as `sk-export-...`. Do not enter a model-call API key, MCP API token, or admin API key.
15+
:::
16+
17+
:::info Export key scope
18+
An app-scoped LLM `log_export_key` exports only logs for the underlying QuilrAI API key it belongs to. If the dashboard shows traffic for the same app name but this playground returns zero rows, the requests may have been made with a different app key. Use that key's export key or an all-apps export key.
19+
:::
20+
21+
<LogExportPlayground />
22+
23+
## What It Calls
24+
25+
The LLM Gateway export endpoint is:
26+
27+
```http
28+
GET /llmgateway/logs/export
29+
X-Quilr-Log-Export-Key: sk-export-...
30+
```
31+
32+
The MCP Gateway export endpoint is:
33+
34+
```http
35+
GET /mcpgateway/logs/export
36+
X-Quilr-Log-Export-Key: sk-export-...
37+
```
38+
39+
The playground sends `start_time`, `end_time`, and `limit` query parameters for the first request. If the API returns `checkpoint.has_more: true`, it follows `checkpoint.next_cursor` until it reaches the selected row limit or the export window is complete.
40+
41+
If the selected range falls outside the 15-day retention window, the playground moves the start time forward to the earliest available export time before sending the request. If the end time is newer than the 15-minute export lag allows, it moves the end time back to the latest exportable time.
42+
43+
## Export Format
44+
45+
The download is a UTF-8 CSV with a byte-order mark so spreadsheet tools such as Microsoft Excel detect the encoding correctly. JSON-shaped fields, such as predictions or payload text, are serialized into a single CSV cell.
46+
47+
For automation, use the local test script in this repo:
48+
49+
```bash
50+
QUILR_LOG_EXPORT_KEY="sk-export-..." \
51+
node scripts/test-log-export.mjs \
52+
--baseUrl https://guardrails-india-1.quilr.ai \
53+
--gateway llm \
54+
--startTime 2026-05-28T00:00:00Z \
55+
--maxRows 1000 \
56+
--output /private/tmp/quilr-llm-logs.csv
57+
```

0 commit comments

Comments
 (0)