-
Notifications
You must be signed in to change notification settings - Fork 1
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
Improve key quantization and add command length #19
base: deployed-in-platform
Are you sure you want to change the base?
Conversation
f61d84d
to
393b236
Compare
@@ -54,6 +54,9 @@ def request(op, *args) | |||
cmd = Quantize.format_command(op, args) | |||
span.set_tag(Ext::TAG_COMMAND, cmd) | |||
end | |||
# BEGIN BRAZE MODIFICATION | |||
span.set_tag(Ext::TAG_LENGTH, Core::Utils.utf8_encode([op, *args].join(' ').strip, binary: true).length) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the Quantize.format_command(op, args)
above
already ran Core::Utils.utf8_encode(command, binary: true, placeholder: placeholder)
I think it would be better to only run that once, the cost of this observability is pretty high already for the use of dalli, which gets used all the time.
Also, should this tag only be added when datadog_configuration[:command_enabled]
is true?
command = command.gsub(GUID_ID_REGEX, "GUID") | ||
command = command.gsub(BSON_ID_REGEX, "BSON") | ||
command = command.gsub(XXHASH_REGEX, "XXHASH") | ||
command = command.gsub(INTEGER_ID_REGEX, "INTEGER") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could have negative perf impact, also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will be too bad, but I'm curious if there are some relatively quick ideas we could do to make this faster. I could smush all of these together into a single expression and just replace it with ID
This should allow us to quantize the keys better.
Also provides a new LENGTH tag on the spans to help identify large cached items better