# tfmetrics

> Org-wide Terraform metrics from static parsing: inventory, version drift, module adoption and hygiene, without terraform init, plan or state.

- URL: https://rossedman.io/projects/tfmetrics/

`tfmetrics` reads the `.tf` files in your repos and turns them into one consistent set of metrics. It never runs Terraform, never touches state and needs no cloud credentials. Point it at a directory, a git URL or a whole GitHub org.

- **Inventory.** Modules, resources, data sources and module calls for every repo, labeled by owner from `CODEOWNERS` or a custom property.
- **Version drift.** How many releases each module call, provider constraint and `required_version` is behind the latest.
- **`who-uses`.** Every caller of a module or provider, with the file, line, version and owner, for planning an upgrade.
- **A hygiene score** from 0 to 100: pinned modules, typed and described variables, version constraints and clean parses.
- **Seven sinks**: JSON, OpenMetrics, OTLP, CSV, Parquet, Markdown for a PR comment, and SARIF for code scanning.
- **Cached by commit**, so a nightly org scan only clones the repos that changed.

The [docs site](https://rossedman.io/tfmetrics/) has tutorials for a first org audit, a PR check and a module upgrade campaign.
