Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use get or unregister successfully #22

Open
elzibubble opened this issue Jul 15, 2019 · 1 comment
Open

Can't use get or unregister successfully #22

elzibubble opened this issue Jul 15, 2019 · 1 comment

Comments

@elzibubble
Copy link

Vaguely related to #11, I'm using Integrant and getting "Collector already registered that provides name: default_logic_process_duration_count"

Should be an easy fix, I just need to see if the collector is already registered and if it is, don't re-register it. My problem is that I can't seem to make get or unregister work. I guess I'm supplying the wrong arguments? Doc isn't helping.

  (:require [messenger.metrics :as metrics]
            [iapetos.core :as iap]
            [iapetos.registry :as iapreg]
            [iapetos.collector :as iapcoll]))

(def process-latency-histogram
  (iap/histogram
   :logic-process-duration
   {:description "Time in seconds that worker.streams.logic-process took"
    :labels [:action :step :state]
    :buckets [0.001 0.005 0.01 0.02 0.05 0.1 0.2 0.5 1.0 2.0]}))

(defonce metrics-registry
  (let [mr metrics/metrics-registry]
    (when (iapreg/get mr (iapcoll/metric process-latency-histogram) (:labels process-latency-histogram))
      (iap/unregister mr (iapcoll/metric process-latency-histogram)))
    (iap/register mr process-latency-histogram)))

I've also tried "logic-process-duration", "logic_process_duration", "default_logic_process_duration_count", :logic-process-duraion, :logic_process_duration, :default/logic_process_duration, :default/logic-process-duration...

I also tried iapreg/clear but that also didn't seem to work, I tried it both with doto and -> :(

Help, please?

@MalloZup
Copy link
Member

@lxsli thx for issue in the short-term we need to adress some issue After that I might find to have look on this. thx for your report and pacience 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants