Micrometer: Micrometer expose process_starttime_seconds in nanoseconds instead of seconds

Created on 22 Oct 2017  路  10Comments  路  Source: micrometer-metrics/micrometer

Issue
Micrometer expose process_starttime_seconds in nanoseconds instead of seconds

Steps to reproduce
When I access prometheus endpoint starttime is:

# HELP process_starttime_seconds The starttime of the Java virtual machine
# TYPE process_starttime_seconds gauge
process_starttime_seconds 1.508362615301E9

Notice that value is in scientific notation (E9). When it value saved into backend, the value will be 1508362615.301 seconds.

Affected versions
v1.0.0-rc.2

doc-update

Most helpful comment

All 10 comments

The UptimeMetrics register the Management Beans provided value with the correct TimeUnit (milliseconds) into micrometers MeterRegistry. For the Prometheus integration the value is scaled to seconds.
What is wrong with 1508362615 seconds and 301 milliseconds?
http://www.convert-unix-time.com/?t=1508362615

Agree with @mweirauch. It seems to be reporting the correct value. Prometheus' StandardExport also scales this value to seconds.

Excuse me for my confusion.

When I looked at the @boeboe dashboard[1], I thought that start time had another meaning. However, the meaning was clear with @mweirauch explanation.

The value of the metric is correct. Apparently there is a problem in dashboard presentation (the dashboard should format the start time value as http://www.convert-unix-time.com/?t=1508362615), but that's another story.

[1] https://grafana.com/api/dashboards/3308/images/2093/image

Btw, Grafana 4.6.0 will provide a means of showing dates based on timestamps (ms). (Automatically adding the date when crossing the day boundary.)

bildschirmfoto vom 2017-10-24 19-24-59

@mweirauch How did you set up your grafana dashboard to show "start time"?

When I tried to configure, my dashboard displays a date of 1970.

My timestamp is 1508424790.

Convert-unix-time show it (http://www.convert-unix-time.com/?t=1508424790):
image

My dashboard configuration (metric):
image

My dashboard configuration (option):
image

I'm using grafana 4.6.0-stable.

@danielmenezesbr

You need to convert to milliseconds:

process_start_time_seconds * 1000

@danielmenezesbr I have updated the dashboard available on grafana.com to reflect the new changes based on Grafana 4.6.0.

@boeboe Thanks!

Was this page helpful?
0 / 5 - 0 ratings