Skip to content

Conversation

@cedricziel
Copy link
Contributor

@cedricziel cedricziel commented Mar 29, 2025

This adds connection tracking to the new pdo subclasses in PHP 8.4

It also fixes an issue where the hierarchy of a trace was not correctly maintained.

Also combines attribute tracking into one cohesive method.

Fixes: open-telemetry/opentelemetry-php#1469

Context: https://www.php.net/releases/8.4/en.php#pdo_driver_specific_subclasses

@cedricziel cedricziel requested a review from a team as a code owner March 29, 2025 08:40
@codecov
Copy link

codecov bot commented Mar 29, 2025

Codecov Report

Attention: Patch coverage is 96.87500% with 2 lines in your changes missing coverage. Please review.

Project coverage is 79.70%. Comparing base (ea137c0) to head (697d399).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/Instrumentation/PDO/src/PDOInstrumentation.php 94.87% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #338      +/-   ##
============================================
+ Coverage     79.45%   79.70%   +0.24%     
- Complexity     1772     1787      +15     
============================================
  Files           137      137              
  Lines          7568     7626      +58     
============================================
+ Hits           6013     6078      +65     
+ Misses         1555     1548       -7     
Flag Coverage Δ
Aws 92.24% <ø> (ø)
Context/Swoole 0.00% <ø> (ø)
Instrumentation/CakePHP 20.27% <ø> (ø)
Instrumentation/CodeIgniter 73.77% <ø> (ø)
Instrumentation/Curl 90.42% <ø> (ø)
Instrumentation/Doctrine 93.25% <ø> (ø)
Instrumentation/ExtAmqp 89.26% <ø> (ø)
Instrumentation/ExtRdKafka 86.23% <ø> (ø)
Instrumentation/Guzzle 69.51% <ø> (ø)
Instrumentation/HttpAsyncClient 78.31% <ø> (ø)
Instrumentation/IO 70.68% <ø> (ø)
Instrumentation/Laravel 64.07% <ø> (ø)
Instrumentation/MongoDB 74.28% <ø> (ø)
Instrumentation/MySqli 95.81% <ø> (ø)
Instrumentation/OpenAIPHP 87.31% <ø> (ø)
Instrumentation/PDO 94.23% <96.87%> (+4.07%) ⬆️
Instrumentation/Psr14 77.14% <ø> (ø)
Instrumentation/Psr15 89.41% <ø> (ø)
Instrumentation/Psr16 97.56% <ø> (ø)
Instrumentation/Psr18 77.77% <ø> (ø)
Instrumentation/Psr3 59.49% <ø> (ø)
Instrumentation/Psr6 97.67% <ø> (ø)
Instrumentation/Slim 86.30% <ø> (ø)
Instrumentation/Symfony 84.93% <ø> (ø)
Instrumentation/Yii 77.68% <ø> (ø)
Logs/Monolog 100.00% <ø> (ø)
Propagation/ServerTiming 100.00% <ø> (ø)
Propagation/TraceResponse 100.00% <ø> (ø)
ResourceDetectors/Azure 91.66% <ø> (ø)
ResourceDetectors/Container 93.02% <ø> (ø)
Sampler/RuleBased 33.51% <ø> (ø)
Shims/OpenTracing 92.45% <ø> (ø)
Symfony 87.81% <ø> (ø)
Utils/Test 70.49% <ø> (ø)

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

Files with missing lines Coverage Δ
src/Instrumentation/PDO/src/PDOTracker.php 94.04% <100.00%> (+17.77%) ⬆️
src/Instrumentation/PDO/src/PDOInstrumentation.php 94.29% <94.87%> (-0.07%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea137c0...697d399. Read the comment docs.

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

@cedricziel cedricziel changed the title fix: Track attributes for new PDO subclasses fix: Track attributes for new PDO subclasses & span hierarchy Mar 29, 2025
@brettmc
Copy link
Contributor

brettmc commented Apr 8, 2025

@cedricziel - is this ready to merge?

@cedricziel
Copy link
Contributor Author

@brettmc ready!

@brettmc brettmc merged commit 26ef1c2 into open-telemetry:main Apr 9, 2025
131 checks passed
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.

(Contrib) PDO Connection Tracker stopped providing correct attributes for a given PDO

6 participants