-
Notifications
You must be signed in to change notification settings - Fork 436
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
ddtrace/tracer: obfuscate stats #1069
Conversation
b58f915
to
588e13a
Compare
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.
Let's please hold off on enabling client-computed stats by default. We currently have 0 production customers using this feature. We should get a few to validate that the go tracer is working properly before enabling this by default for 100% of customers who upgrade.
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.
Looks great!
One question about the obfuscation module.
Let's figure out whether this is enabled/disabled by default and then get it in.
func obfuscatedResource(o *obfuscate.Obfuscator, typ, resource string) string { | ||
if o == nil { | ||
return resource | ||
} | ||
switch typ { | ||
case "sql", "cassandra": | ||
oq, err := o.ObfuscateSQLString(resource) | ||
if err != nil { | ||
log.Error("Error obfuscating stats group resource %q: %v", resource, err) | ||
return textNonParsable | ||
} | ||
return oq.Query | ||
case "redis": | ||
return o.QuantizeRedisString(resource) | ||
default: | ||
return resource | ||
} | ||
} | ||
|
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.
🥳 🎉
@@ -3,6 +3,7 @@ module gopkg.in/DataDog/dd-trace-go.v1 | |||
go 1.12 | |||
|
|||
require ( | |||
github.com/DataDog/datadog-agent/pkg/obfuscate v0.0.0-20211129110424-6491aa3bf583 |
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.
Any chance we can get a proper mod version here?
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.
Not yet. We'll have to use the pseudo-version format until the Datadog Agent is released, and an official tag is assigned to this module. It should be fine. Do you see any risk associated with this approach, until that happens?
@pkalmakis that's done in the latest commit. PTAL |
This change introduces obfuscation of stats aggregation key resources by using the same code as used in the trace-agent. For now, it is disabled by default and under the "obfuscate_stats" feature flag.
09f9690
to
719c849
Compare
This change introduces obfuscation of stats aggregation key resources by
using the same code as used in the trace-agent.
This feature continues to be off by default, enablable using the
discovery
feature flag.