Add telemetry framework

- Add shared telemetry module
- Add common telemetry helpers
- Ignore Python cache files
This commit is contained in:
2026-07-21 11:29:25 -04:00
parent b372552294
commit 080f10a1e0
3 changed files with 20 additions and 0 deletions
View File
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env python3
from pathlib import Path
from datetime import datetime, timezone
import json
def timestamp():
return datetime.now(timezone.utc).isoformat()
def write_json(path, payload):
path = Path(path)
path.parent.mkdir(parents=True, exist_ok=True)
payload["generated_at"] = timestamp()
tmp = path.with_suffix(".tmp")
tmp.write_text(json.dumps(payload, indent=2) + "\n")
tmp.replace(path)