statsviz icon indicating copy to clipboard operation
statsviz copied to clipboard

[go] add Custom metrics

Open Issif opened this issue 3 years ago • 4 comments

Thanks for this tool, it's really useful for debug.

Could it be possible to add custom metrics and not only those expose by runtime?

I'm developping an application and it exposes a lot of internal metrics.

Thank.

Issif avatar Jan 10 '21 13:01 Issif

Thank you. Adding custom metrics is also an idea I've had for statsviz but at the moment it's not possible. The thing is statsviz is made from 2 parts, Go publishes metrics and a web page presents them, both have been developed to show the Go runtime metrics only, and thus many things are hardcoded. Allowing to present arbitrary metrics would be nice but require quite a lot of new stuff, refactoring and new code, we're not there yet.

arl avatar Jan 10 '21 14:01 arl

Ok I see. I'll take a deeper look if I find time for and submit a PR. Thanks.

Issif avatar Jan 10 '21 14:01 Issif

Ok great. Since that would be an important change, please feel free to share your design/prototype and/or any questions with me here. Happy to help

arl avatar Jan 10 '21 15:01 arl

Maybe the publishing part could be easily done via expvars.

arl avatar Jan 10 '21 15:01 arl

With the new rewrite released in #75. Adding custom user plots is going to be easier. That's a feature that I had ion mind for the rewrite so even if it's not yet available, it's going to be, and doing it is going to be way easier than in previous versions, since the list of plots is now dynamically defined.

arl avatar Sep 05 '22 12:09 arl