arl / statsviz

🚀 Visualise your Go program runtime metrics in real time in the browser
MIT License
3.19k stars 121 forks source link

[Question] import/export metrics from/to external tsdb ? #89

Closed zhiqiangxu closed 1 year ago

zhiqiangxu commented 1 year ago

Can statsviz be used to show history runtime metric stored in external tsdb ?

Otherwise the stats is gone after a restart.

arl commented 1 year ago

At the moment, you can't export nor import data out of/into Statsviz.

Statsviz has been developed to be a learning and profiling tool, aimed at simplicity of use, to learn about go garbage collector as well as help in real-time profiling.

Being able to store and reload stats would be nice, but I don't want to turn statsviz into a full fledged grafana+prometheus.

If we were to add this feature, we'd probably just be able to save/load blocks with 10minutes worth of data, without any possibility to look at successive blocks at the same time. Would that limitation still make Statsviz work for your use case?

zhiqiangxu commented 1 year ago

At the moment, you can't export nor import data out of/into Statsviz.

Statsviz has been developed to be a learning and profiling tool, aimed at simplicity of use, to learn about go garbage collector as well as help in real-time profiling.

Being able to store and reload stats would be nice, but I don't want to turn statsviz into a full fledged grafana+prometheus.

If we were to add this feature, we'd probably just be able to save/load blocks with 10minutes worth of data, without any possibility to look at successive blocks at the same time. Would that limitation still make Statsviz work for your use case?

I think the better abstraction needed is a front end UI utility to display general metrics data, either imported or right collected in process in real-time ?

arl commented 1 year ago

I think the better abstraction needed is a front end UI utility to display general metrics data, either imported or right collected in process in real-time

The more I think about it the more I think that for this use case, one should switch to another metrics system. Statsviz is not going to compete (as in: offer the same feature set) as say, grafana+prometheus. Most metrics shown in Statsviz are already exported by Prometheus. Statsviz main advantages are its quick installation (go get) and ease of use (open the browser).

s3rj1k commented 3 months ago

@arl Just to bump this up, would be nice to have the extra ability to dump data into folder as maybe JSONL format or if this is an unlikely extension, maybe an utility that acts like browser and instead of providing UI just collects data ?