         reg (:registry monitoring)
         _ (when-not reg (throw (Exception. "Monitoring component is not setup")))
         tag ["job" job-name "task" task-name "peer-id" (str id)]
-        cnt-replica-version (c/counter reg (conj tag "replica-version"))
-        cnt-epoch (c/counter reg (conj tag "epoch"))
+        replica-version (AtomicLong.)
+        epoch (AtomicLong.)
+        gg-replica-version (g/gauge-fn reg (conj tag "replica-version") (fn [] (.get ^AtomicLong replica-version)))
+        gg-epoch (g/gauge-fn reg (conj tag "epoch") (fn [] (.get ^AtomicLong epoch)))
         epoch-rate (m/meter reg  (conj tag "epoch-rate"))
-        update-rv-epoch-fn (update-rv-epoch cnt-replica-version cnt-epoch epoch-rate)]
+        update-rv-epoch-fn (update-rv-epoch replica-version epoch epoch-rate)]
     {:onyx.core/monitoring (reduce 
                             (fn [mon lifecycle]
                               (assoc mon 


(def calls
  {:lifecycle/before-task-start before-task})


  (:import [java.util.concurrent TimeUnit]
           [java.util.concurrent.atomic AtomicLong]
           [com.codahale.metrics Gauge]))

(defn new-lifecycle-latency [reg tag lifecycle]
  (let [timer ^com.codahale.metrics.Timer (t/timer reg (into tag ["task-lifecycle" (name lifecycle)]))] 
