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
tracer: support dot notation for tags with array values #2253
Conversation
BenchmarksBenchmark execution time: 2023-11-20 16:34:14 Comparing candidate commit d97386a in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 39 metrics, 2 unstable metrics. |
This PR is stale because it has been open 20 days with no activity. Remove stale label or comment or this will be closed in 10 days. |
Adding a comment to un-mark this as stale. I still want to do this, but I haven't had time to manually test it yet. |
Because these changes will cause
I'm not terribly concerned by 2 nanoseconds, but it could in theory add up if someone has many tags. I moved the check to be as low down the list of checks as possible so it's hopefully not hit in most cases (I expect the majority of tags are strings, ints, floats). |
The parametric tests caught a bug in the way we were encoding the value, which should now be fixed. The system-tests PR is here: DataDog/system-tests#1841 |
And the failing parametric test in this PR is because it relies on old behavior. DataDog/system-tests#1841 will skip that test and enable the new one. |
What does this PR do?
Improves array support in tag values by automatically encoding arrays with dot notation.
With the following code snippet:
Before (just a string):
After (an array):
Note that this only supports one level of array nesting. Any more, and the user will need to do this manually.
AIT-8525
Motivation
This supports more precise search queries and filtering. For example, with the previous code, a
DD_APM_REPLACE_TAG
withcustom
would have removed the entire array. Now, aDD_APM_REPLACE_TAG
withcustom
will do nothing. A customer will instead specify the index, e.g. aDD_APM_REPLACE_TAG
withcustom.1
, to only redact the indices they want, or docustom.*
to redact them all.Reviewer's Checklist
For Datadog employees:
@DataDog/security-design-and-guidance
.Unsure? Have a question? Request a review!