-
Notifications
You must be signed in to change notification settings - Fork 136
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
Set max size for maxBufferSize #196
Comments
Hi @bwidermeli I have never seen an issue opened on this (and definitely haven't seen this in the hot-shots usage I've had). Really interesting. Could you share some of your hot-shots settings? Most interested in the 'protocol' and if you have tried changing that. |
Sure!
So, we actually have no protocol settings yet as we were using the [email protected] version and we are just migrating now to the 8.6.1. Any ideas? |
Even when we changed to the updated version, we had no need of setting the protocol though |
Hmm. Not sure if anybody else has seen this and I'm still stumped. Anything unusual about your DogStatsD usage, have you asked Datadog about that? Also, anything unusual in how you call hot-shots- is it some kind of indirect or functional programming call where it could be accidentally called a bunch of times? As you can see from my questions, I'm wondering about things outside of hot-shots. Outside of adding debug tracing to see the calls going out, not sure what else can be done in this library for this. |
Hmm, I did ask Datadog but need to enable the log_level to info and
activate the flare for tracing, is there any way we can do that with a
configuration? As we cannot execute a linux command on the production
instances. Do you have any idea of other way to activate this tracing?
And about how we are calling it, nope, for example the
easiest implementation is just an histogram for the response time of the
application, and that is just a simple histogram with one value and two
tags, and that is also failing unluckily. No logic that can be called a
bunch of times :/
|
Update: Just found the issue, looks like it's a problem with the bufferHolder, when the maxBufferSize is set to 10000 for example with no bufferInterval, we have this problem. |
Well that's interesting! Sorry a bit intermittent here for awhile so may be slower to respond. Did changing settings work to fix it? I'd still want to keep this issue open to be clear, until we have a test case and fix in there for the combination, but wanted to make sure that does make it fine. |
No problem at all!
Yup, setting the maxBufferSize to 0 fixes the issue, even though would be
nice to know how to fix it, I'm still looking for a solution on this, as it
is much better to send a couple metrics instead of just sending them on
each metric we need to push.
… |
Hello Brian! |
@bwidermeli Well that's good to know, glad you figured it out. I switched the title of this bug now and will keep it open until the following is done: when using udp the maxBufferSize switches back to size 8192 if set higher than this value with a console log as to why, and the README to updated to indicate the max value allowed |
Sounds great Brian! Thanks a lot for taking on this! |
From the official agent docs the agent buffer size is configurable.
|
@xzyfer Yes, they added that after we (Mercado Libre) had a really long talk with the whole team because of this. And we also added a fixed 8KB to the buffer_size on a wrapper we use on the whole company, so this would never happen again in our projects at least. |
This isn't safe as currently implemented because it's comparing the length of strings, which is NOT the same as comparing bytes. If the characters used happen to fall within the ascii range, these will be the same, but each utf-8 character could be up to 4 bytes, making the max safe value 2,048. This should hold the buffer as a |
If you have the metric example with value 1
It gets pushed this way:
e = 1
ex = 1
exa = 1
exam = 1
examp = 1
exampl = 1
example = 1
I am not sure if this happens due to a problem on the lib or you might know why this is happening, I saw that it might be when the message gets converted into a Buffer, but I don't think the problem is right there, I have been trying to replicate the issue locally with no luck, so I cannot debug it and do not know where it is actually happening.
Right now we are having thousands of USD on unused metrics on Datadog due to this. For example:
You can see the issue on the inconsistency tag key or even in the scope or other keys.
The text was updated successfully, but these errors were encountered: