site icon indicating copy to clipboard operation
site copied to clipboard

Check xtdb indexing in healthcheck endpoint?

Open peter-wilkins opened this issue 2 years ago • 0 comments

We are using ECS and during deployments the load balancers are switched before site is functional. We suspect it is due to xtdb indexing. Would it be useful to check if xtdb lag is within a threshold in wrap-healthcheck?

(defn xtdb-tx-lag []
  (let [node (xtdb-node)
        tx-id (fn [tx] (get tx ::xt/tx-id 0))]
    (- (tx-id (xt/latest-submitted-tx node))
       (tx-id (xt/latest-completed-tx node)))))

peter-wilkins avatar Nov 22 '23 16:11 peter-wilkins