Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keep gauges values after statsd server restart #705

Open
mkdugi opened this issue May 14, 2020 · 2 comments
Open

keep gauges values after statsd server restart #705

mkdugi opened this issue May 14, 2020 · 2 comments

Comments

@mkdugi
Copy link

mkdugi commented May 14, 2020

Hi,
I'm in loved in statsd protocol simplicity. I'm using statsd gauges + graphite + grafana to meter rising values, where I have acces only to delta.
But there is a problem for me. When statsd server restarts, i'm loosing gagues values, where I would like to keep them for a long time (month at least).
Of course I know that statsd is not dedicated to use in this way, but...
Is there a way to preserve gaguses values during statsd server restart?

Best regards!

@BlueHatbRit
Copy link
Member

Hi @mkdugi, I would question why you're restarting statsd enough for this to be a problem? We usually assume statsd will just run forever for the most part until you no longer need it or need to patch it.

We don't really have any support for reloading previous state when booting up, I'd be reluctant to add it as it could be quite complex to dump the state reliably.

Can you give a bit more info on your use case here?

@mkdugi
Copy link
Author

mkdugi commented May 20, 2020

Hi @BlueHatbRit,
I'm not working with 99,999% servers, HA clusters etc. In my case server restart (and statsd with it) is little more often (every 30 - 60 days). And I'm looking for solutions suits me.
Statsd restart is not a problem for counters and timings. It is a problem for gauges, which values are lost. It is a problem, because I have access only for deltas. For example I want count pump work time to know when change oil in pump. I gets info about current work time in seconds every pump stop so i need to sum it with previous time: pump.X:+125|g.
Statsd reset resets this gauge.

I've found jbuchbinder old statsd-c server code which have "serialize state to and from file" option.
I forked it, modified: forced to work with graphite and added +/- functionality for gauges, and it works.
Whet it is killed with SIGQUIT signal it wrotes data to file. And reades it at start.

I think, that such option in Your statsd server would be a good idea. Only for gauges different than 0.

Best regards!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants