CLI and library for parsing, deduplicating, and analyzing browser exception logs exported from Grafana Faro/Loki.
uv tool install .No environment variables required. Faro-tools works entirely with local CSV files — no API keys.
| Command | What it does |
|---|---|
faro parse <input.csv> |
Parse a Faro CSV export into JSONL and/or a fingerprint summary |
In Grafana, open the Explore view pointed at your Loki datasource. Filter for Faro exceptions (e.g. {app="faro"}), run the query for the time range you want, then click Download → CSV. The resulting file is what faro parse expects.
# Write structured JSONL (one exception per line) faro parse exceptions.csv --jsonl output/parsed.jsonl # Write a fingerprint summary (grouped by root cause) faro parse exceptions.csv --summary output/summary.json # Write both at once faro parse exceptions.csv --jsonl output/parsed.jsonl --summary output/summary.json
A fingerprint is a 16-character SHA-256 hash that groups exceptions by root cause. Two exceptions get the same fingerprint if their error messages and first two stack frames match after normalization — meaning dynamic values like chunk hashes (-CGwR7Gyd.js), line numbers (:142:38), hex IDs, and request IDs are stripped before hashing.
This means 500 occurrences of the same underlying bug produce one fingerprint entry in the summary, not 500 separate entries.
{
"total_exceptions": 1000,
"unique_fingerprints": 231,
"fingerprints": [
{
"fingerprint": "2f7de1e789b7afd7",
"error_family": "dynamic-import-failure",
"count": 216,
"affected_users": 1,
"sample_value": "console.error: Importing a module script failed.",
"sample_stacktrace": "...",
"browsers": ["Safari", "Chrome", "Mobile Safari"],
"first_seen": "2026-01-14T13:52:12.095000",
"last_seen": "2026-02-03T13:43:22.852000"
}
]
}Fingerprints are sorted by count descending, so the most common errors appear first.
The error_family field classifies each error into one of these buckets:
| Family | Matches |
|---|---|
dynamic-import-failure |
Module loading errors (chunk fetch failures) |
metamask-connection |
MetaMask/Web3 wallet errors |
invariant-violation |
Assertion/invariant failures |
undefined-property |
Cannot read properties of undefined |
reference-error |
X is not defined |
network-error |
Network errors |
timeout-error |
Timeout errors |
non-error-thrown |
Non-Error objects thrown as exceptions |
unknown |
Everything else |
Use the Jupyter notebook at notebooks/explore_logs.ipynb. It loads the CSV, builds a DataFrame, and has sections for overview stats, top error families, time series, browser breakdown, and triage classification.
Install notebook dependencies first:
uv sync --group notebooks uv run jupyter lab notebooks/explore_logs.ipynb
Set CSV_PATH in the first code cell to your export file. Drop CSV files in notebooks/data/ — that directory is gitignored.
Yes. The public API is importable directly:
from faro_tools import ( parse_csv_file, # Iterator[FaroException] parse_csv_row, # dict -> FaroException write_jsonl, # exceptions + path -> int (count written) write_summary, # exceptions + path -> summary dict exception_to_dict, # FaroException -> JSON-serializable dict DefaultFingerprinter, compute_fingerprint, get_error_family, ) exceptions = list(parse_csv_file("export.csv")) summary = write_summary(exceptions, "summary.json") print(f"{summary['unique_fingerprints']} unique fingerprints across {summary['total_exceptions']} exceptions")
Implement the Fingerprinter protocol and pass it to parse_csv_file or parse_csv_row:
from faro_tools.fingerprint import Fingerprinter class MyFingerprinter: VERSION = "custom-1.0" def compute(self, value: str, stacktrace: str | None) -> str: # Return a string key — exceptions with the same key are grouped return value.split(":")[0].strip()[:32] def get_error_family(self, value: str) -> str: return "custom" exceptions = list(parse_csv_file("export.csv", fingerprinter=MyFingerprinter()))
# Top 10 error values by count cat output/parsed.jsonl | jq -r '.value' | sort | uniq -c | sort -rn | head -10 # Only mobile errors cat output/parsed.jsonl | jq 'select(.is_mobile == true)' # Errors affecting a specific user cat output/parsed.jsonl | jq 'select(.user_id == "user123")' # All unique error families cat output/parsed.jsonl | jq -r '.error_family' | sort -u