GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - CervantesVive/faro-tools: Parse and analyze Grafana Faro browser exception logs

BranchesTags
Open more actions menu

Latest commit

 

History

19 Commits
19 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
notebooks
notebooks
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 

Repository files navigation

faro-tools

CLI and library for parsing, deduplicating, and analyzing browser exception logs exported from Grafana Faro/Loki.

Install

uv tool install .

Prerequisites

No environment variables required. Faro-tools works entirely with local CSV files — no API keys.

Commands

Command What it does
faro parse <input.csv> Parse a Faro CSV export into JSONL and/or a fingerprint summary

FAQ

How do I get a CSV export from Grafana?

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.

How do I parse a CSV export?

# 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

What is a fingerprint?

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.

What does the summary JSON look like?

{
  "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.

What error families are there?

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

How do I explore the data interactively?

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.

Can I use faro-tools as a Python library instead of the CLI?

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")

How do I plug in a custom fingerprinting strategy?

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()))

How do I filter the JSONL output with jq?

# 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

About

Parse and analyze Grafana Faro browser exception logs

Topics

browser-errorsclierror-fingerprintingexception-parsingfarografanalog-analysisobservability

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.