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

Support gauge delta #36

Open
dpetrick opened this issue Aug 1, 2017 · 6 comments
Open

Support gauge delta #36

dpetrick opened this issue Aug 1, 2017 · 6 comments

Comments

@dpetrick
Copy link

dpetrick commented Aug 1, 2017

Hi,

apparently, statsd supports sending deltas for gauges.
Sifting through the code, it doesn't look like deltas are supported at the moment. Is this a known issue, an oversight, or an intentional design choice?

If desired, I can submit a PR myself when I find the time.

Cheers,
Dom

@masci
Copy link
Contributor

masci commented Nov 13, 2017

Hi @dpetrick this is actually by design, see the docs at https://docs.datadoghq.com/guides/dogstatsd/ and this issue detailing when we decided not to support the feature: DataDog/dd-agent#2104

@prasadasokan
Copy link

prasadasokan commented Feb 2, 2018

If delta isn't supported, how will one be able to measure something like current active users logged in to the application or number of active DB connections open? We would also want to decrement when someone logs out of the application, or when the DB connection is closed. How is that done? Can you help us understand? We use Telegraf and Influx as the backend.

@acjay
Copy link

acjay commented Apr 17, 2018

@prasadasokan I'm accomplishing this with a Java AtomicInteger to manually track my total, updateAndGet to modify it, and then send the resulting total as my gauge value. I'm sure most runtimes have similar capability. But totally agree that a way to send gauge deltas natively would be really nice. If I were making really high volume changes, there could be contention for my count variable and performance impact.

@lostcolony
Copy link

@acjay What happens if your service restarts?

@acjay
Copy link

acjay commented Dec 7, 2018

@lostcolony Not at the same company anymore, but as this was for a live connection count on web sockets, all the clients would have to reestablish their connections from zero, anyway. But yeah, I can see how this wouldn't work for all situations.

@LMojica
Copy link

LMojica commented Jan 15, 2020

I was looking to migrate my client from the tim-group/java-statsd-client to this one, but I'm currently using the other client's recordGaugeDelta method, which this client doesn't implement. That method has been working fine for me. Can't that implementation just be copied over to this one so it doesn't break things for those of us who are looking to migrate over to this one?

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

6 participants