Skip to content

Added sampling options when an inbound traceparent exists #2279

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
Mar 20, 2025

Conversation

jbedell-newrelic
Copy link
Contributor

New config options for how to sample when we have sampling data from an upstream entity.

Possible values:
default: New Relic's standard sampling rules will be used.
always_on: Always sample spans in this case.
always_off: Always skip sampling in this case.

YML config

distributed_tracing:
    sampler:
      remote_parent_sampled: default
      remote_parent_not_sampled: default

So, setting remote_parent_sampled to always_on would tell the agent to try and always sample anything that an upstream entity told us was sampled, until the sampling reservoir is full.

Or, setting remote_parent_not_sampled to always_off would tell the agent to not bother sampling anything if the upstream entity told us that it was not sampled.

@codecov-commenter
Copy link

codecov-commenter commented Mar 19, 2025

Codecov Report

Attention: Patch coverage is 81.81818% with 4 lines in your changes missing coverage. Please review.

Project coverage is 70.55%. Comparing base (76029c1) to head (f983d50).

Files with missing lines Patch % Lines
.../src/main/java/com/newrelic/agent/Transaction.java 73.33% 1 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2279      +/-   ##
============================================
- Coverage     70.77%   70.55%   -0.23%     
+ Complexity    10186    10030     -156     
============================================
  Files           844      844              
  Lines         41171    40590     -581     
  Branches       6301     6155     -146     
============================================
- Hits          29139    28637     -502     
+ Misses         9224     9171      -53     
+ Partials       2808     2782      -26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jbedell-newrelic jbedell-newrelic merged commit 8d38009 into main Mar 20, 2025
121 checks passed
@github-project-automation github-project-automation bot moved this from Triage to Code Complete/Done in Java Engineering Board Mar 20, 2025
@jbedell-newrelic jbedell-newrelic deleted the w3c_sampled branch March 20, 2025 20:59
@jbedell-newrelic
Copy link
Contributor Author

Resolves #2222

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants