yahoo / fili

Easily make RESTful web services for time series reporting with Big Data analytics engines like Druid and SQL Databases.
http://fili.io
Apache License 2.0
172 stars 96 forks source link

Add a Metric library metric that indicates Fili uptime #333

Open cdeszaq opened 7 years ago

cdeszaq commented 7 years ago

It would be good to know how long the system (the Fili app) has been up since it last restarted. One particular reason is many metrics are "lifelong" counters, and they are much more useful when you know how long the "life" is.

Also, aligning logs with the numbers reported by the metrics is much easier if you have this checkpoint.

kevinhinterlong commented 7 years ago

I'm not sure if there's a specific place where we add in gauges/metrics but it seems pretty straightforward

MetricRegistryFactory.getRegistry().register("uptime",
        (Gauge<Long>) () -> ManagementFactory.getRuntimeMXBean().getUptime()
);