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

ddtrace/tracer: obfuscate stats #1069

Merged
merged 9 commits into from
Dec 3, 2021
Merged

ddtrace/tracer: obfuscate stats #1069

merged 9 commits into from
Dec 3, 2021

Conversation

gbbr
Copy link
Contributor

@gbbr gbbr commented Nov 29, 2021

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.

piochelepiotr
piochelepiotr previously approved these changes Nov 29, 2021
piochelepiotr
piochelepiotr previously approved these changes Nov 29, 2021
ddtrace/tracer/option.go Outdated Show resolved Hide resolved
Copy link
Contributor

@pkalmakis pkalmakis left a 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.

Copy link
Contributor

@knusbaum knusbaum left a 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.

Comment on lines +408 to +426
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
}
}

Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Contributor Author

@gbbr gbbr Dec 2, 2021

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?

@gbbr
Copy link
Contributor Author

gbbr commented Dec 2, 2021

@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.
piochelepiotr
piochelepiotr previously approved these changes Dec 3, 2021
@gbbr gbbr merged commit f55a622 into v1 Dec 3, 2021
@gbbr gbbr deleted the gbbr/obfuscate-stats branch December 3, 2021 14:51
felixge added a commit that referenced this pull request Dec 21, 2021
felixge added a commit that referenced this pull request Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants