Giter Site home page Giter Site logo

Comments (6)

ncabatoff avatar ncabatoff commented on June 7, 2024

I like the idea, though it'll probably be an opt-in behaviour based on a command-line argument. I see two ways these metrics could be exposed. (1) Add a new template variable ThreadName that can be used in the template that builds groupnames. Or (2) add a ThreadName label to the CPU and IO metrics and break down all metrics of threaded processes accordingly. Unthreaded processes would have ThreadName=groupname. I'm leaning towards (2) because it would allow doing sum() over groupname to get the existing aggregate metrics. What do you think?

from process-exporter.

flixr avatar flixr commented on June 7, 2024

Yes, I think this should be optional/configurable, either globally or per process...
For exposing, (2) basically sounds good to me. I would even say the aggregated process metrics should be kept in any case, as this is way cheaper than summing again to get the whole process metrics.
But just saying that having ThreadName=groupname equals the whole process IMHO won't work then...

from process-exporter.

ncabatoff avatar ncabatoff commented on June 7, 2024

Maybe rather than adding a new dimension to the existing metrics, these per-threadname metrics should have new metric names altogether. Then we keep the aggregated process metrics as you suggest, and people can always use rewrite rules to selectively discard unneeded per-threadname metrics.

from process-exporter.

ncabatoff avatar ncabatoff commented on June 7, 2024

Well, that was way more disruptive than I expected, so don't be surprised if I broke something. I hadn't done any major work on this project since last year, and coming back to it now I found it was hard to understand. The good news is that I was able to make some of the APIs cleaner, I rewrote the tests to be more understandable (or at least more readable I hope), and we now have per-thread CPU/IO/page fault metrics. The format isn't exactly the same as used for the groupname statistics, but it does reflect where I think they're headed (see #21). Example:

namedprocess_namegroup_thread_count{groupname="chromium-browse",threadname="SimpleCacheWork"} 5
namedprocess_namegroup_thread_cpu_seconds_total{cpumode="system",groupname="chromium-browse",threadname="SimpleCacheWork"} 0.16999999999999993
namedprocess_namegroup_thread_cpu_seconds_total{cpumode="user",groupname="chromium-browse",threadname="SimpleCacheWork"} 0.07000000000000006
namedprocess_namegroup_thread_io_bytes_total{groupname="chromium-browse",iomode="read",threadname="SimpleCacheWork"} 7.613094e+06
namedprocess_namegroup_thread_io_bytes_total{groupname="chromium-browse",iomode="write",threadname="SimpleCacheWork"} 1.871672e+06
namedprocess_namegroup_thread_major_page_faults_total{groupname="chromium-browse",threadname="SimpleCacheWork"} 0
namedprocess_namegroup_thread_minor_page_faults_total{groupname="chromium-browse",threadname="SimpleCacheWork"} 505

I left major/minor page faults unmerged because I don't think it's sensible to sum them, which is what that would imply.

from process-exporter.

flixr avatar flixr commented on June 7, 2024

Sweet!!
Just one minor comment: maybe rename cpumode to mode to have the same naming as the prometheus node_exporter? But that is not really that important....

from process-exporter.

ncabatoff avatar ncabatoff commented on June 7, 2024

I thought about it, but it felt weird to qualify "iomode" but not "cpumode".

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.