Got lots of warning logs (java.lang.NoSuchFieldError: timestampMs) when timestamp field is unset
See original GitHub issueHi Prometheus,
This is Yang from OpenCensus. Last year we added an OpenCensus Prometheus exporter that exports metrics to Prometheus end points. I saw you added an optional "timestamp"
value as part of metric sample in https://github.com/prometheus/client_java/pull/337 - on OpenCensus we haven’t updated our exporter to set this field. However, when our users were using the OpenCensus Prometheus exporter, they got a bunch of warning logs saying (original issue: https://github.com/census-instrumentation/opencensus-java/issues/1215):
[WARNING]
java.lang.NoSuchFieldError: timestampMs
at io.prometheus.client.exporter.common.TextFormat.write004 (TextFormat.java:49)
at io.prometheus.client.exporter.HTTPServer$HTTPMetricHandler.handle (HTTPServer.java:59)
at com.sun.net.httpserver.Filter$Chain.doFilter (Filter.java:77)
at sun.net.httpserver.AuthFilter.doFilter (AuthFilter.java:82)
at com.sun.net.httpserver.Filter$Chain.doFilter (Filter.java:80)
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle (ServerImpl.java:685)
at com.sun.net.httpserver.Filter$Chain.doFilter (Filter.java:77)
at sun.net.httpserver.ServerImpl$Exchange.run (ServerImpl.java:657)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
at java.lang.Thread.run (Thread.java:844)
Since "timestamp"
is an optional field, would it be better to reduce such warning logs when it is unset in the metric sample?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Error "java.lang.NoSuchFieldError - Stack Overflow
This is caused by a dependency mismatch between jackson libs and joda. It is working for you when using only the original Maven...
Read more >Java Logging Basics - The Ultimate Guide To Logging - Loggly
Loggers are created and called in the code of your Java application, where they generate events before passing them to an Appender. A...
Read more >27. Logging - Spring
Spring Boot uses Commons Logging for all internal logging but leaves the underlying log implementation open. Default configurations are provided for Java ......
Read more >Avoid These 9 Logging Problems in Your Java Application
Getting started with logging in your Java application can be quite easy. Learn how to do logging right and get the most out...
Read more >How To Do Logging In Java - Marco Behler
As is the case for every logging library, first you get a Logger for a specific class or package, and then you can...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Closing for now, this could be resolved by using a consistent version of Prometheus simple client for the library and users’ application.
@pavanbhosle Back then I used
v0.3.0
for both simpleclient and simpleclient_common. I’d assume as long as you use a consistent version for both jars, it should work fine.