 
 (defn -main
   [& args]
-  (let [config       (cli/configure "Kuona Jenkins build collector." cli-options args)
-        source       (jenkins/http-source {:username (-> config :username) :password (-> config :password)})
-        build-server (:jenkins config)
-        api-url      (-> config :api-url)]
+  (let [config            (cli/configure "Kuona Jenkins build collector." cli-options args)
+        username          (-> config :username)
+        password          (-> config :password)
+        build-server      (-> config :jenkins)
+        api-url           (-> config :api-url)
+        source            (jenkins/http-source {:username username :password password})
+        collector-details {:name "jenkins-collector" :version (util/get-project-version 'kuona-jenkins-collector)}]
+
     (log/info "Collecting metrics from:" build-server)
 
-    (log-collection api-url collector-details [{:api api-url} {:build-server build-server}] #(jenkins/collect-metrics source build-server api-url))))
+    (log-collection api-url
+                    collector-details
+                    [{:api api-url} {:build-server build-server}]
+                    #(jenkins/collect-metrics source
+                                              build-server
+                                              api-url))))
 

(ns jenkins-collector.main
  (:require [clj-http.client :as http]
            [clojure.string :as string]
            [cheshire.core :refer :all]
            [clojure.tools.logging :as log]
            [slingshot.slingshot :refer :all]
            [kuona-core.metric.store :as store]
            [kuona-core.util :as util]
            [kuona-core.cli :as cli]
            [jenkins-collector.jenkins :as jenkins])
  (:gen-class))

(def cli-options

  (let [metrics (jenkins/collect-metrics (jenkins/http-source (:credentials config)) (:url config))]
    (doall (map #(store/put-document % mapping) metrics))))

(defn collector-log
  "Posts details of the collector to the API server to record the collector run"
  [api-url collector-details parameters status]
