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

java.lang.ClassCastException with Cassandra version 4.1.2 #118

Open
adithyagokhale opened this issue Oct 8, 2023 · 0 comments
Open

java.lang.ClassCastException with Cassandra version 4.1.2 #118

adithyagokhale opened this issue Oct 8, 2023 · 0 comments

Comments

@adithyagokhale
Copy link

Exporter reports too many of following exceptions with Cassandra version 4.1.2

Starting Cassandra exporter
JVM_OPTS:  -XX:MaxRAMFraction=2 -XX:+AlwaysPreTouch -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat="yyyy-MM-dd'T'HH:mm:ss" -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=5555 -Dcom.sun.management.jmxremote.local.only=false -Dnetworkaddress.cache.ttl=15
CASSANDRA_EXPORTER_CONFIG_host 127.0.0.1:7199
CASSANDRA_EXPORTER_CONFIG_listenPort 5556
Waiting for Cassandra JMX to start on  127.0.0.1:7199
Waiting for Cassandra JMX to start on  127.0.0.1:7199
Waiting for Cassandra JMX to start on  127.0.0.1:7199
Waiting for Cassandra JMX to start on  127.0.0.1:7199
Waiting for Cassandra JMX to start on  127.0.0.1:7199
Waiting for Cassandra JMX to start on  127.0.0.1:7199
Waiting for Cassandra JMX to start on  127.0.0.1:7199
OpenJDK 64-Bit Server VM warning: Option MaxRAMFraction was deprecated in version 10.0 and will likely be removed in a future release.
"2023-10-03T11:27:43" [main] INFO com.criteo.nosql.cassandra.exporter.Config - Loading yaml config from /tmp/config.yml
"2023-10-03T11:27:52" [main] INFO com.criteo.nosql.cassandra.exporter.JmxScraper - Scrap took 7180ms for the whole run
"2023-10-03T11:28:39" [main] INFO com.criteo.nosql.cassandra.exporter.JmxScraper - Scrap took 4279ms for the whole run
"2023-10-03T11:29:29" [main] INFO com.criteo.nosql.cassandra.exporter.JmxScraper - Scrap took 4396ms for the whole run
"2023-10-03T11:30:18" [main] INFO com.criteo.nosql.cassandra.exporter.JmxScraper - Scrap took 3602ms for the whole run
"2023-10-03T11:31:07" [main] INFO com.criteo.nosql.cassandra.exporter.JmxScraper - Scrap took 2299ms for the whole run
"2023-10-03T11:31:55" [main] ERROR com.criteo.nosql.cassandra.exporter.Main - Scrapper stopped due to uncaught exception
java.lang.ClassCastException: class java.lang.String cannot be cast to class java.lang.Number (java.lang.String and java.lang.Number are in module java.base of loader 'bootstrap')
        at com.criteo.nosql.cassandra.exporter.JmxScraper.updateMetric(JmxScraper.java:311)
        at com.criteo.nosql.cassandra.exporter.JmxScraper.lambda$run$12(JmxScraper.java:204)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
        at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
        at java.base/java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:274)
        at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177)
        at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
        at java.base/java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1621)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
        at com.criteo.nosql.cassandra.exporter.JmxScraper.run(JmxScraper.java:204)
        at com.criteo.nosql.cassandra.exporter.Main.start(Main.java:44)
        at com.criteo.nosql.cassandra.exporter.Main.main(Main.java:30)
"2023-10-03T11:31:57" [main] ERROR com.criteo.nosql.cassandra.exporter.Main - Scrapper stopped due to uncaught exception

Looks like it does not publish all the metrics due to this error. Can someone have a look at this ?

exporter uses SLF4J simple logger and there is no way to change the output log format. Is there a plan to support log4J ? This is needed to convert log messages into JSON for observability stack(EFK).

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

No branches or pull requests

1 participant