question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Got lots of warning logs (java.lang.NoSuchFieldError: timestampMs) when timestamp field is unset

See original GitHub issue

Hi 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:closed
  • Created 5 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
songy23commented, Jun 1, 2018

Closing for now, this could be resolved by using a consistent version of Prometheus simple client for the library and users’ application.

0reactions
songy23commented, Oct 15, 2020

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found