Last active
January 30, 2019 00:24
-
-
Save rboyd/de554c7cdc977cc827a19a071c297ad4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn instrument-resolvers! | |
"Look for any fns matching the pattern resolve-.* in the ns*, instrument them with | |
iapetos for Prometheus monitoring." | |
[ns* registry] | |
(doseq [resolver-str (filter #(re-matches #"resolve-.*" (str %)) (keys (ns-publics (ns-name ns*))))] | |
(->> resolver-str symbol resolve (iapetos.collector.fn/instrument! registry)))) | |
(instrument-resolvers! *ns* registry) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment