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

Improve key quantization and add command length #19

Open
wants to merge 1 commit into
base: deployed-in-platform
Choose a base branch
from

Conversation

zachmccormick
Copy link
Member

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

@@ -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)

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?

Comment on lines +30 to +33
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")

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

Copy link
Member Author

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

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

Successfully merging this pull request may close these issues.

2 participants