Skip to content

Conversation

ZNeumann
Copy link
Contributor

This implements the sampling spec to allow control over the agent sampling decisions based on the value in the sampled flag of an inbound traceparent header.

@newrelic-php-agent-bot
Copy link

newrelic-php-agent-bot commented Jul 25, 2025

Test Suite Status Result
Multiverse 16/16 passing
SOAK 80/85 passing

@codecov-commenter
Copy link

codecov-commenter commented Jul 25, 2025

Codecov Report

❌ Patch coverage is 91.66667% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.14%. Comparing base (22d0138) to head (6b4bad0).

Files with missing lines Patch % Lines
agent/php_nrini.c 91.66% 2 Missing ⚠️
axiom/nr_distributed_trace.c 90.47% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1104      +/-   ##
==========================================
+ Coverage   78.11%   78.14%   +0.02%     
==========================================
  Files         193      193              
  Lines       27991    28039      +48     
==========================================
+ Hits        21866    21910      +44     
- Misses       6125     6129       +4     
Flag Coverage Δ
agent-for-php-7.2 78.39% <91.66%> (+0.02%) ⬆️
agent-for-php-7.3 78.41% <91.66%> (+0.02%) ⬆️
agent-for-php-7.4 78.27% <91.66%> (+0.02%) ⬆️
agent-for-php-8.0 77.47% <91.66%> (+0.02%) ⬆️
agent-for-php-8.1 77.78% <91.66%> (+0.02%) ⬆️
agent-for-php-8.2 77.39% <91.66%> (+0.02%) ⬆️
agent-for-php-8.3 77.39% <91.66%> (+0.02%) ⬆️
agent-for-php-8.4 77.41% <91.66%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@zsistla zsistla added this to the next-release milestone Aug 11, 2025
Comment on lines +34 to +35
'traceparent' => "00-74be672b84ddc4e4b28be285632bbc0a-27ddd2d8890283b4-00",
'tracestate' => "123@nr=0-0-1349956-41346604-27ddd2d8890283b4-b28be285632bbc0a-1-1.1273-1569367663277"
Copy link
Member

@lavarou lavarou Aug 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting case: traceparent flags don't have sampled set, but New Relic's tracestate has sampled flag set. Regardless, agent respects always_off. This test also shows that remote_parent_not_sampled INI is only applicable to tracestate's sampled flag.

lavarou
lavarou previously approved these changes Aug 19, 2025
…ers_not_sampled_non_newrelic.php

Co-authored-by: Michal Nowacki <[email protected]>
…ers_not_sampled_non_newrelic.php

Co-authored-by: Michal Nowacki <[email protected]>
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.

5 participants