← Projects

Project · Go · Apache-2.0

tfmetrics active

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

shell
brew install rossedman/tap/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 has tutorials for a first org audit, a PR check and a module upgrade campaign.

Writing about tfmetrics

  1. Introducing tfmetrics: Terraform Metrics for a Whole Org, Without Running Terraform tfmetrics reads the .tf files across your repos and turns them into inventory, version drift, module adoption and hygiene metrics. No terraform init, no plan, no state and no cloud credentials. 7 min read