Fork me on GitHub
#clj-commons
<
2023-07-14
>
RAJKUMAR00:07:39

I need a help related to clj-commons/iapetos

RAJKUMAR00:07:57

I've below sample code

RAJKUMAR00:07:00

(ns metrics-demo
      (:require [iapetos.core :as p]))

(defn register-kinesis-collectors [registry]
      (p/register
            registry
            (p/counter :kinesis/total
                  {:description "Count of kinesis messages read total"}
                  {:lazy? false}
                  )))

(defn -main [& args]
      (let [registry (iapetos.registry/create)]
            (register-kinesis-collectors registry)
            (-> registry (p/inc :kinesis/total))))

RAJKUMAR00:07:23

when I run this code I get below error

RAJKUMAR00:07:25

Execution error (IllegalArgumentException) at iapetos.operations/eval439$fn$G (operations.clj:16).
No implementation of method: :increment* of protocol: #'iapetos.operations/IncrementableCollector found for class: nil

Full report at:
/var/folders/b_/_t677thx43n6pd8l8x0c1qjr0000gp/T/clojure-44856649865685158.edn

RAJKUMAR00:07:07

Any idea how to fix this ?

seancorfield02:07:52

The error says you're passing nil where it expects a counter, so I'd suggest double-checking the API docs to make sure you're using the functions correctly.