{"id":32187580,"url":"https://github.com/jitlogic/micrometer-clj","last_synced_at":"2025-10-22T00:10:15.577Z","repository":{"id":62433056,"uuid":"266786769","full_name":"jitlogic/micrometer-clj","owner":"jitlogic","description":"Wrappers for micrometer library","archived":false,"fork":false,"pushed_at":"2020-06-28T04:46:36.000Z","size":105,"stargazers_count":7,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-20T23:24:44.338Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jitlogic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-2.0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-25T13:30:19.000Z","updated_at":"2024-08-28T00:44:42.000Z","dependencies_parsed_at":"2022-11-01T21:00:46.602Z","dependency_job_id":null,"html_url":"https://github.com/jitlogic/micrometer-clj","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jitlogic/micrometer-clj","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jitlogic%2Fmicrometer-clj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jitlogic%2Fmicrometer-clj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jitlogic%2Fmicrometer-clj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jitlogic%2Fmicrometer-clj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jitlogic","download_url":"https://codeload.github.com/jitlogic/micrometer-clj/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jitlogic%2Fmicrometer-clj/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280151532,"owners_count":26281248,"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","status":"online","status_checked_at":"2025-10-20T02:00:06.978Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-10-22T00:06:37.378Z","updated_at":"2025-10-22T00:10:15.562Z","avatar_url":"https://github.com/jitlogic.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# micrometer-clj\n\nClojure wrapper for java micrometer library. Provides several functions and macros wrapping micrometer meters.\n\nLatest jar:\n\n[![Clojars Project](https://clojars.org/io.resonant/micrometer-clj/latest-version.svg)](https://clojars.org/io.resonant/micrometer-clj) \n\n[![cljdoc badge](https://cljdoc.org/badge/io.resonant/micrometer-clj)](https://cljdoc.org/d/io.resonant/micrometer-clj)\n\nImport micrometer namespace:\n\n```clojure\n(ns example \n  (:require [io.resonant.micrometer :as m]))\n```\n\n## Creating meter registry\n\nMeter registries are created using single `metrics` function supplied with configuration. Creating and using simple \nin-memory meter registry:\n\n```clojure\n(m/configure {:type :simple, :tags {:foo \"BAR\"}})\n\n(defn -main [\u0026 args]\n  (m/timed [\"some.metric\" {:baz \"BAG\"}]\n    (Thread/sleep 3000)))\n```\n\nWhen using global meter registry is not desired, it is possible to declare own registry using `metrics` function and\ncreate custom meters using `get-*` functions:\n\n```clojure\n(let [registry (m/meter-registry {:type :prometheus})\n      timer    (m/get-timer registry \"frobnication.time\" {:location \"WAW\"} \n                {:description \"Frobnication request handling\"})\n      errors   (m/get-counter registry \"frobnication.errors\" {:location \"WAW\"} \n                {:description \"Number of frobnication errors\", :base-unit \"err\"})]\n  (m/timed [timer] \n    (try\n      (frobnicate)\n    (catch Exception _\n      (m/add-counter errors 1)))))\n``` \n\n## Listing and querying meters\n\nFunction `list-meters` will return names of all meters in a registry:\n\n```clojure\n(m/list-meters)  ; there is also variant that accepts \"registry\" parameter\n{:names [\"process.uptime\" \"jvm.gc.max.data.size\" \"jvm.threads.peak\" ... \"jvm.threads.daemon\"]}\n```\n\nIn order to query specific meter use `query-meters` function:\n\n```clojure\n(m/inspect-meter \"jvm.memory.used\") ; there is also variant that accepts \"registry\" parameter\n{:name \"jvm.memory.used\",\n :measurements ({:statistic \"VALUE\", :value 2.90950008E8}),\n :availableTags {\"area\" [\"heap\" \"nonheap\"],\n                 \"id\" [\"Compressed Class Space\" \"G1 Eden Space\" \"CodeHeap 'non-nmethods'\" \"CodeHeap 'profiled nmethods'\"\n                       \"CodeHeap 'non-profiled nmethods'\" \"Metaspace\" \"G1 Survivor Space\" \"G1 Old Gen\"]},\n :description \"The amount of used memory\",\n :baseUnit \"bytes\"}\n```\n\nIt is possible to query meters for specific tag:\n\n```clojure\n(m/query-meter registry \"jvm.memory.used\" {\"area\" \"heap\"})\n{:name \"jvm.memory.used\",\n :measurements ({:statistic \"VALUE\", :value 2.18463168E8}),\n :availableTags {\"area\" [\"heap\"], \"id\" [\"G1 Eden Space\" \"G1 Survivor Space\" \"G1 Old Gen\"]},\n :description \"The amount of used memory\",\n :baseUnit \"bytes\"}\n```\n\n## More information\n\nFor more detailed documentation, see following documents:\n\n* [REGISTRY](doc/REGISTRY.md) - creating and configuring meter registry, information about all supported implementations;\n\n* [METERS](doc/METERS.md) - creating and using meters of various types;\n\n* [DRIVERS](doc/DRIVERS.md) - various meter registry backends list and configuration options;\n\n\n## License\n\nCopyright © Rafal Lewczuk 2020 rafal.lewczuk@jitlogic.com\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    http://www.apache.org/licenses/LICENSE-2.0\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%2Fjitlogic%2Fmicrometer-clj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjitlogic%2Fmicrometer-clj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjitlogic%2Fmicrometer-clj/lists"}