Skip to main content

icetrace

Cut Apache Iceberg query & storage bills in 10 seconds.

PyPI License: Apache-2.0 Python 3.11+

Zero data scanned. Strictly read-only. Diagnose → Safe Fix Plan → Verify for Apache Iceberg — from your terminal, CI/CD, Cursor, or Claude Code.

icetrace connects to your catalog (AWS Glue, Polaris, Lakekeeper, Nessie, S3 Tables, Hive, or SQL), reads only metadata (zero data files scanned, strictly read-only), and closes the full optimization loop:

  1. Diagnose — X-ray an entire database (icetrace scan) or simulate exact 4-stage scan pruning (icetrace explain) to catch silent pruning bugs and dead snapshot storage (icetrace roi).
  2. Fix safely — Generate risk-ordered, copy-pasteable remediation scripts for Spark, Athena, Trino, AWS Glue, or PyIceberg (icetrace fix), complete with rollback commands, pre-checks, and PR/Jira Markdown runbooks.
  3. Verify & Gate in CI — Prove the fix worked with icetrace diff and block future regressions in GitHub Actions / GitLab CI with icetrace check.

Try It in 5 Seconds (No Credentials Required)

uvx icetrace demo

# Or preview the generated fix plan for your own engine:
uvx icetrace demo --engine athena   # spark | athena | trino | glue | pyiceberg

Or run the full loop on your own catalog — read-only, zero infrastructure to deploy:

# 1. X-ray an entire database and rank worst offenders (0–100)
ICETRACE_CATALOG_TYPE=glue icetrace scan --namespace analytics

# 2. Generate a safe, risk-ordered fix plan (with rollback & verify commands)
ICETRACE_CATALOG_TYPE=glue icetrace fix analytics.events --engine glue --show-rollback

# 3. Export a PR / Jira runbook or pipe runnable SQL
ICETRACE_CATALOG_TYPE=glue icetrace fix analytics.events --engine spark --format markdown

# 4. Gate table health in CI/CD (exits 1 on violation)
ICETRACE_CATALOG_TYPE=glue icetrace check analytics.events --min-score 75 --fail-on-missing-metrics

Agent-Native Workflow (Cursor & Claude Code MCP)

icetrace-mcp exposes 9 strictly read-only MCP tools plus a companion Agent Skill. Because generate_fix_plan returns structured properties_to_set, repo_search_hints, rollback_commands, and verification commands, your coding agent can diagnose a production table, patch the dbt model / Terraform / Spark job in your repo, and verify the new snapshot after deployment:

"Scan our analytics database, generate a safe Glue fix plan for the worst table, and update its Terraform/Spark config in this repo."
"Why did WHERE tenant_id = 'org_prod_8491' scan 180 GB on analytics.events, and what's the safest fix?"

Claude Code:

claude mcp add --transport stdio --scope user icetrace -- uvx --from "icetrace[glue]" icetrace-mcp

Cursor (.cursor/mcp.json or ~/.cursor/mcp.json):

{
  "mcpServers": {
    "icetrace": {
      "command": "uvx",
      "args": ["--from", "icetrace[glue]", "icetrace-mcp"],
      "env": {
        "ICETRACE_CATALOG_TYPE": "glue",
        "AWS_PROFILE": "${env:AWS_PROFILE}",
        "AWS_REGION": "us-east-1"
      }
    }
  }
}

Why Teams Actually Use This

Query engines (Athena, Trino, Spark, ClickHouse, Snowflake) execute your query and hand you the bill — they don't tell you why Iceberg failed to skip files or how to fix it safely. icetrace catches the exact silent traps that cause 10x–100x over-scanning:

  • Columns past #32 have zero bounds (MISSING_METRICS_COL_LIMIT) — Iceberg stops recording min/max stats after column 32 by default.
  • 16-char string truncation collisions (TRUNCATED_BOUNDS) — default truncate(16) collapses prefixed IDs/URIs (org_prod_us_east_...) across every file, turning data skipping to 0%.
  • Compaction destroyed your clustering (OVERLAPPING_RANGES) — binpack or arrival-order writes make every file span the full domain (overlap = 0.98).
  • Missing writer stats & interleaved manifests — catches zero-copy add_files jobs that omitted Parquet stats, evolved partition-spec mismatches, and V2/V3 delete-file amplification.
  • Ghost storage in old snapshots — measures exact historical-only bytes locked in un-expired snapshots.

Install

# Zero-install (recommended)
uvx icetrace demo

# Homebrew (macOS / Linux)
brew tap sanspareilsmyn/icetrace https://github.com/sanspareilsmyn/icetrace
brew install icetrace

# uv tool (with AWS Glue & S3)
uv tool install "icetrace[glue]"

Works out of the box with ~/.pyiceberg.yaml, ICETRACE_CATALOG_TYPE (glue, rest, sql, hive), and standard AWS/GCP credentials.


9 Read-Only Tools (CLI & MCP)

CLI / MCP Tool What You Get (Metadata Only)
scan / scan_catalog Concurrently X-ray all tables in a database, score 0–100, rank worst offenders by cost & waste.
fix / generate_fix_plan Risk-ordered Spark/Athena/Trino/Glue/PyIceberg fix scripts, rollback commands, repo patch hints, and verification commands.
check / check_table_policy CI/CD health gate (--min-score, --max-overlap, --fail-on-missing-metrics, exit code 1 on failure).
roi / simulate_roi Historical snapshot S3 waste ($/mo) + What-If scan reduction (% & Athena $/mo) per fix.
explain / explain_scan 4-stage pruning funnel (100% parity with PyIceberg plan_files()) + per-file root-cause attribution.
audit / audit_pruning_health Per-column pruning grade (A–F), bounds coverage, truncate(N) collision %, and $O(N \log N)$ sweep-line overlap ratio.
diff / diff_snapshots Pinpoint which commit spiked manifests, dropped bounds, or regressed query pruning.
inspect / inspect_table_layout Instant metadata.json view (format version, column ordinals, evolved partition specs, sort order).
tables / list_tables Catalog & namespace discovery.

Safety First — Built for Production Tables

  • Strictly Read-Only — never mutates, compacts, or expires tables (readOnlyHint: true, destructiveHint: false). icetrace fix generates reviewable scripts; it never executes them.
  • Risk-Tiered Remediation — always orders SAFE_METADATA_ONLY → COMPUTE_REWRITE (with snapshot rollback) → DESTRUCTIVE_CLEANUP (safe 7-day / retain_last=5 defaults + pre-checks).
  • Manifest-Safe Defaults — uses bounded truncate(32)/truncate(64) on string columns instead of unbounded full to prevent Avro manifest bloat.
  • Zero Data Scanned & 100% Local — reads only metadata files (16-way concurrent, bounded by max_manifests); credentials never leave your machine.

Roadmap · Changelog · Agent Skill · Contributing · Apache-2.0

Metadata

Release files for icetrace 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for icetrace 0.3.0
File Size Uploaded Provenance Actions
icetrace-0.3.0.tar.gz 298.1 kB With provenance Details for icetrace-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for icetrace 0.3.0
File Interpreter ABI Platform Actions
icetrace-0.3.0-py3-none-any.whl Python 3 none any Details for icetrace-0.3.0-py3-none-any.whl

Total release size: 361.5 kB

Release files / icetrace-0.3.0.tar.gz

Download URL icetrace-0.3.0.tar.gz
Size 298.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ba042fc66f926e287cdb5efd0637a31f886a6e3f0fe11f1cbdeb721d183c8f67
BLAKE2b-256 checksum
How to use checksums
4bc6180bf66bfb81d13109d5868b9f7c4d7794e969f5f954e60ce96106a39603
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / icetrace-0.3.0-py3-none-any.whl

Download URL icetrace-0.3.0-py3-none-any.whl
Size 63.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a19dc188da001716b0fb917a202d688a1265037ffd8f6a651ece2de3c394504
BLAKE2b-256 checksum
How to use checksums
dfa9370ec51bedd4e1067654ec073ea56e22a20caea6c6f0fd07ad5bb1311881
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Security for icetrace 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for icetrace-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page