Skip to content

Can't use get or unregister successfully #22

@elzibubble

Description

@elzibubble

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions