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: added UnmarshalJSON method to sampling rules #2563

Merged
merged 6 commits into from Feb 26, 2024

Conversation

dianashevchenko
Copy link
Contributor

@dianashevchenko dianashevchenko commented Feb 15, 2024

What does this PR do?

AIT-9799
This PR adds a UnmarshalJSON method on the SamplingRule struct. This is similar to unmarshalSamplingRules method which was used previously to process env variables.
Both methods utilise one validation function, however there's NO assertion on the rule type presence.

Motivation

Motivated by the dynamic sampling initiative, where one must be able to set sampling rules through an RC, thus requiring to unmarshal data from the request.

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

For Datadog employees:

  • If this PR touches code that handles credentials of any kind, such as Datadog API keys, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.

Unsure? Have a question? Request a review!

@pr-commenter
Copy link

pr-commenter bot commented Feb 15, 2024

Benchmarks

Benchmark execution time: 2024-02-19 12:34:52

Comparing candidate commit fc07b6d in PR branch shevchenko/sampling-unmarshal-method with baseline commit 655e11c in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 40 metrics, 1 unstable metrics.

@dianashevchenko dianashevchenko marked this pull request as ready for review February 19, 2024 12:19
@dianashevchenko dianashevchenko requested a review from a team as a code owner February 19, 2024 12:19
@dianashevchenko dianashevchenko enabled auto-merge (squash) February 26, 2024 14:01
@dianashevchenko dianashevchenko merged commit 5b310de into main Feb 26, 2024
156 of 157 checks passed
@dianashevchenko dianashevchenko deleted the shevchenko/sampling-unmarshal-method branch February 26, 2024 14:07
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.

None yet

2 participants