-
Notifications
You must be signed in to change notification settings - Fork 375
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
ElasticSearch body quantization #362
Conversation
docs/GettingStarted.md
Outdated
@@ -274,6 +274,7 @@ Where `options` is an optional `Hash` that accepts the following parameters: | |||
| Key | Description | Default | | |||
| --- | --- | --- | | |||
| ``service_name`` | Service name used for `elasticsearch` instrumentation | elasticsearch | | |||
| ``quantize`` | Hash containing options for quantization. May include `:keep` with an Array of keys to not quantize, or `:exclude` with Array of keys to exclude entirely. | {} | |
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.
Instead of keep
, I would say to call it show
since the value was already there with/without this config (it's just obfuscated or not). What do you think?
Also there is a way to say "show all fields" (aka disabling the quantizer/obfuscator)
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.
Hmmm, show
is reasonable. Really orients the concept towards UI display, but that's not necessarily a bad thing. Only bad if they think not "showing" is "hiding", and that old data that wasn't "shown" can simply be revealed later by changing the setting, as opposed to it actually being permanently lost.
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 think we could probably add some setting for show all... maybe if instead of passing an array to show
, you pass true
? or a symbol :all
? (I lean towards the symbol.)
7d13d09
to
ebe65fb
Compare
ebe65fb
to
64546f6
Compare
span.set_tag(BODY, body) if body | ||
if body | ||
quantize_options = Datadog.configuration[:elasticsearch][:quantize] | ||
quantized_body = Datadog::Contrib::Elasticsearch::Quantize.format_body(body, quantize_options) |
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.
we should probably catch any kind of exception here
|
||
def format_body(body, options = {}) | ||
format_body!(body, options) | ||
rescue StandardError |
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.
👍
Adds enhanced quantization for ElasticSearch body tags. This behavior is activated by default, but can be configured with:
Which would change:
Into: