-
Notifications
You must be signed in to change notification settings - Fork 174
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
Not sending float numbers that are less than 1 for Counters to datadog. #220
Comments
Hey there @jingyuanswitchco. I am actually not sure of the behavior of non-integer counters. This likely undefined behavior for us because when we think of counters we increment them in whole numbers. Thanks for opening the issue, we will write up a test case and check. As for the change in behavior, we didn't explicitly change anything that I think would have affected this behavior, but since it's undefined perhaps we did! |
Thanks for the super fast response @cory-stripe!. I will also try to check with the latest code and verify whether it fixed the issue and update you if I find something. |
No problem! If you find anything suspicious do let us know. Otherwise we'll hopefully find it by writing some test cases. |
I saw the latest code is using golang 1.9. However on the official website: https://golang.org/dl/. It is listing go1.9 as unstable version. I am wondering why does Veneur need to upgrade to 1.9? Or is it possible I can still compile it using go1.8.3? |
It's possible to still use 1.8.3, but we use 1.9 for our internal stuff. |
I am trying to compile the latest code with 1.8.3. But I run into the error when running command gofmt -w .: |
Ah, yes. I believe we had to make some changes for |
No worries:) I just tried to run the latest code. The same issue is still there. Do you plan to get this fixed? |
I plan to write some tests to exercise it, but I have no ETA on this. We've got some other stuff in progress at the moment. |
Is it possible you can quickly point me to the code where we are handling this. And I can investigate it. |
I'm unsure. You could write a test in the sampler testing code to see if perhaps the counter doesn't work. Outside of that you'd have to test the JSON marshaling code. I'm also unsure if Datadog even works with a float counter, but your issue implies it does. Othewise, I'm sorry but I can't tell you a specific time. This being OSS we have other obligations and these come as we can get to them! |
Thanks Cory! Yes datadog agent worked fine with float counters. |
Hi Cory, I found: Line 84 in 47f0a97
this line is essentially change a float to an integer. Which would convert float number that is smaller than 1 to 0. Since the sample was passed in as a float64, I am wondering why do we want to force it to convert it to int64? If I want to submit a change and not converting sample to int64, is it an acceptable change? Thanks, |
Line 79 in 47f0a97
It seems like it is because Counter is defined as an int64. Not sure if I changed it to float64 something will be broken. |
Gotya, in rereading this issue I now see that I misunderstood the original ask. You are pointing out that Veneur differs from the official DogStatsD client in that it does not work with counters. I misunderstood your original statements to mean that veneur's behavior had changed. Ok, we'll work on this soon. I'm not sure how much work it entails. I'll report back to you! |
Hi Cory, I tried a fix today:
// Sample adds a sample to the counter.
// Flush generates a DDMetric from the current state of this Counter. // Combine merges the values seen with another set (marshalled as a byte slice)
And after I changed the int64 to float64, it seems fixed the issue when I tested this on our infra. Not sure this may violate any design principle for Veneur. Please let me know if this helps. Best, |
Unfortunately I don't think this change is simple. Because of our naive serialization (the bytes above) trying to decode this would fail unless all veneurs were update at the same time. In other words, this would fail if someone sent a byte-encoded int64 to a box expecting a float64. We likely need to redesign this to use floats for everything or something like that. Doing so will require a new import API. I don't think we'll have a quick solution here… |
There is a way to allow deserialization of either float or int types simultaneously, allowing for a gradual upgrade, but it'd be kind of cumbersome and a potentially problematic performance hit. We'd have to profile it and test it out to know whether or not it'd be problematic to update it in production. |
Neat! |
Hi Cory, Just saw you put this as an enhancement. Just want to touch base with you whether this will be fixed soon or it will need more time and there is no ETA to put in the fix. Best, |
No ETA, there's a speed bump here that we don't have an easy way to made this backward compatible, so I'm thinking will look at this for 1.7 or 2.0. |
Hi,
We recently started using veneur to replace datadog agent and exporting data to datadog. We are not using a release code but used the code from github on July 17th. We have observed that for Counter float value that is less than 1 is not getting sent to datadog. I did a workaround to multiply the same metric with 10 (our number is around 0.2) and it is able to be successfully pushed to datadog.
Is this a known issue? Or is it fixed in the later code/release?
Thanks,
Jingyuan
The text was updated successfully, but these errors were encountered: