{"id":15145732,"url":"https://github.com/soundcloud/prometheus-clj","last_synced_at":"2025-09-29T15:31:02.462Z","repository":{"id":15407329,"uuid":"18139360","full_name":"soundcloud/prometheus-clj","owner":"soundcloud","description":"Clojure wrappers for the Prometheus java client","archived":true,"fork":false,"pushed_at":"2020-08-04T07:20:22.000Z","size":42,"stargazers_count":49,"open_issues_count":0,"forks_count":16,"subscribers_count":78,"default_branch":"master","last_synced_at":"2024-04-24T08:15:14.010Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/soundcloud.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-26T13:41:53.000Z","updated_at":"2023-01-28T13:25:48.000Z","dependencies_parsed_at":"2022-08-25T10:11:41.524Z","dependency_job_id":null,"html_url":"https://github.com/soundcloud/prometheus-clj","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soundcloud%2Fprometheus-clj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soundcloud%2Fprometheus-clj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soundcloud%2Fprometheus-clj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soundcloud%2Fprometheus-clj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soundcloud","download_url":"https://codeload.github.com/soundcloud/prometheus-clj/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234634984,"owners_count":18863982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-26T11:42:17.233Z","updated_at":"2025-09-29T15:30:57.200Z","avatar_url":"https://github.com/soundcloud.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# prometheus-clj\n\n\u003e :warning: **Archived**: This prometheus-clj project isn't longer maintained by SoundCloud. Check out [iapetos](https://github.com/clj-commons/iapetos) for an actively maintained Clojure wrapper around the official [Prometheus Java Client](https://github.com/prometheus/client_java).\n\n## Installation\n\n#### Leiningen\n\nprometheus-clj is available from [Clojars](https://clojars.org/com.soundcloud/prometheus-clj).\n\n![Clojars Project](http://clojars.org/com.soundcloud/prometheus-clj/latest-version.svg)\n\n## Usage\n\nRequire prometheus core.\n\n```clojure\n(:require [prometheus.core :as prometheus])\n```\n\nWrap your ring handler so the prometheus client can start collecting metrics about your requests.\n\n```clojure\n(prometheus/instrument-handler handler your-app-name your-prometheus-collector-registry)\n```\n\nCreate a compojure route so that the prometheus server can poll your application for metrics.\n\n```clojure\n(GET \"/metrics\" [] (prometheus/dump-metrics your-prometheus-collector-registry))\n```\n\n## Example with custom metrics\n\n```clojure\n(ns prometheus.example\n  (:require [prometheus.core :as prometheus]\n            [ring.server.standalone :refer [serve]]))\n\n(defonce store (atom nil))\n\n(defn register-metrics [store]\n  (-\u003e\n    store\n    (prometheus/register-counter \"test\" \"some_counter\" \"some test\" [\"foo\"])\n    (prometheus/register-gauge \"test\" \"some_gauge\" \"some test\" [\"foo\"])\n    (prometheus/register-histogram \"test\" \"some_histogram\" \"some test\" [\"foo\"] [0.7 0.8 0.9])))\n\n(defn init! []\n  (-\u003e\u003e (prometheus/init-defaults)\n       (register-metrics)\n       (reset! store)))\n\n(defn handler [_]\n  (prometheus/increase-counter @store \"test\" \"some_counter\" [\"bar\"] 3)\n  (prometheus/set-gauge @store \"test\" \"some_gauge\" 101 [\"bar\"])\n  (prometheus/track-observation @store \"test\" \"some_histogram\" 0.71 [\"bar\"])\n  (prometheus/dump-metrics (:registry @store)))\n\n\n(defn -main [\u0026]\n  (init!)\n  (serve\n    (prometheus/instrument-handler handler\n                                   \"test_app\"\n                                   (:registry @store))))\n\n```\n\nRun the example server:\n\n    lein run -m prometheus.example\n\n## License\n\nCopyright 2014 SoundCloud, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n\u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoundcloud%2Fprometheus-clj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoundcloud%2Fprometheus-clj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoundcloud%2Fprometheus-clj/lists"}