The scripts/generate_telemetry_stats.py script generates EDR telemetry statistics by analyzing the repository's Git history and comparing telemetry matrix files across commits. It records changes to 'telemetry cells' (defined by platform + vendor + telemetry category + telemetry sub-category + status).
Full Rebuild
Use this command to perform a complete recalculation of all statistics from the beginning of the Git history:
python scripts/generate_telemetry_stats.py \
--repo . \
--output data/generated \
--raw-output data/raw/github \
--config config/stats_config.yml \
--format json,jsonl,csv
Incremental Update
For routine updates, use the --incremental flag. This mode reads data/generated/run_metadata.json to find the last processed head_commit and only scans subsequent commits. It appends new events to the existing ledger and regenerates summaries.
Note on Incremental Mode: The script will automatically fall back to a full rebuild if the previous commit is missing from the current branch history or if the schema version has changed.
Note on GitHub Metadata: If the GITHUB_TOKEN environment variable is set, the script enriches the statistics with pull request metadata. Otherwise, it generates statistics based solely on local Git history.
python scripts/generate_telemetry_stats.py \
--repo . \
--output data/generated \
--raw-output data/raw/github \
--config config/stats_config.yml \
--format json,jsonl,csv