diff --git a/nightly_tune.py b/nightly_tune.py index c19dd28..b114eb3 100644 --- a/nightly_tune.py +++ b/nightly_tune.py @@ -46,10 +46,11 @@ def _write_heartbeat(outcome: str) -> None: # The DB row is queryable remotely and survives container churn. try: con = open_research_db("market") + import uuid con.execute( - "INSERT INTO telemetry_events (event_type, source, reason, metadata_json) " - "VALUES (?, ?, ?, ?)", - ["tuner_heartbeat", "nightly_tune", outcome, + "INSERT INTO telemetry_events (id, event_type, source, reason, metadata_json) " + "VALUES (?, ?, ?, ?, ?)", + [str(uuid.uuid4()), "tuner_heartbeat", "nightly_tune", outcome, json.dumps({"ran_at": datetime.now(timezone.utc).isoformat()})]) except Exception: # noqa: BLE001 pass