Skip to content

Fix java tracer resource sampling example #30553

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

Merged
merged 1 commit into from
Jul 18, 2025

Conversation

cecile75
Copy link
Contributor

@cecile75 cecile75 commented Jul 18, 2025

What does this PR do? What is the motivation?

Fix java tracer resource sampling example using system property:

When
-Ddd.trace.sampling.rules='[{\"service\": \"my-service\", \"resource\": \"GET /checkout\", \"sample_rate\":1},{\"service\": \"my-service\", \"sample_rate\":0.2}]' is set, the sampling rule is actually not applied to the spans and an log error is written
ERROR datadog.trace.agent.common.sampling.TraceSamplingRules - Couldn't parse Trace Sampling Rules from JSON:

The correct configuration is
-Ddd.trace.sampling.rules='[{"service": "my-service", "resource": "GET /checkout", "sample_rate":1},{"service": "my-service", "sample_rate":0.2}]'

Merge instructions

Merge readiness:

  • [ x] Ready for merge

Additional notes

@cecile75 cecile75 requested a review from a team as a code owner July 18, 2025 12:53
Copy link
Contributor

github-actions bot commented Jul 18, 2025

✅ Documentation Team Review

The documentation team has approved this pull request. Thank you for your contribution!

Copy link
Contributor

Preview links (active after the build_preview check completes)

Modified Files

@cecile75 cecile75 requested a review from mcculls July 18, 2025 13:37
@michaelcretzman michaelcretzman merged commit f277671 into master Jul 18, 2025
20 of 21 checks passed
@michaelcretzman michaelcretzman deleted the cecile75/fixjavaresourcesamplingexample branch July 18, 2025 19:47
@michaelcretzman michaelcretzman restored the cecile75/fixjavaresourcesamplingexample branch July 18, 2025 19:47
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.

2 participants