Code Monkey home page Code Monkey logo

Comments (3)

ncabatoff avatar ncabatoff commented on June 25, 2024 1

I'm confused: how would doing the calculation in the app instead of in promql help with the graphing?

Personally I'm only ever interested in the uptime to know if the app was restarted, which you can get with changes(namedprocess_namegroup_oldest_start_time_seconds[interval]).

from process-exporter.

Rocketeer007 avatar Rocketeer007 commented on June 25, 2024 1

At the moment, namedprocess_namegroup_oldest_start_time_seconds would have the following data points (using very simplified examples):

Timestamp start_time_seconds Explanation
09:00:00 1534924800 Process started at 2018-08-22 08:00
09:30:00 1534924800 Process is still running, so start time hasn't changed
10:00:00 1534924800 Process is still running, so start time hasn't changed
10:30:00 1534932900 Process restarted at 2018-08-22 10:15
11:00:00 1534932900 Process is still running, so start time hasn't changed

If I graph that using time()-namedprocess_namegroup_oldest_start_time_seconds, I'd get the following points in my graph, depending on when I viewed it (since time() is "now, when the graph is shown"):

Timestamp Result at 11:00 Result at 12:00
09:00:00 3 hours 4 hours
09:30:00 3 hours 4 hours
10:00:00 3 hours 4 hours
10:30:00 45 minutes 1 hour 45 mins
11:00:00 45 mintues 1 hour 45 mins

However, if the process_exporter information included an actual "uptime" for the process, I'd get values that were based on how long the process was running when the scrape took place, as so:

Timestamp start_time_seconds uptime
09:00:00 1534924800 3600
09:30:00 1534924800 5400
10:00:00 1534924800 7200
10:30:00 1534932900 900
11:00:00 1534932900 2700

This would be very easy to graph, and would show a steadily rising line as processes ran, which then reset back to 0 when they were restarted.

If you can think of any other way to display this information, I'd be happy to do it in promql instead - I just can't figure out a way. I think I want scrape timestamp - start_time_seconds, but I have no idea how to get that value.

Alternatively, if you've got a good way of showing how long processes have been running (not just how many time's they've restarted in a particular interval), I'll use that instead.

from process-exporter.

JanKoppe avatar JanKoppe commented on June 25, 2024

I'm currently running into the same issue - I'm trying to replace some old scripts that fed data into graphite with the process-exporter. The purpose is to show the runtime of several cronjobs, giving an indication how long each run takes and if any cronjobs are running abnormaly long. The result is a graph containing a sawtooth pattern.

So far I have not managed to formulate a promql query that will give me this result, a separate uptime gauge would be very useful here.

@Rocketeer007 have you found any solution for this in the meantime?

from process-exporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.