Skip to content

Conversation

@rtreffler
Copy link
Contributor

Binding happened outside the foreach loop resulting in binding the same values for all instrumented clients. Similar problem was affecting span and scope object variables, where multiple clients could overwrite each other spans.

…ng middlewares

Binding happened outside the foreach loop resulting in binding the same values for all instrumented clients.
Similar problem was affecting span and scope object variables, where multiple clients could overwrite each other spans.
@rtreffler rtreffler requested a review from a team as a code owner February 4, 2025 16:16
@welcome
Copy link

welcome bot commented Feb 4, 2025

Thanks for opening your first pull request! If you haven't yet signed our Contributor License Agreement (CLA), then please do so that we can accept your contribution. A link should appear shortly in this PR if you have not already signed one.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 4, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@@ -0,0 +1,149 @@
<?php
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this file is copied almost exactly how it was written in AWS PHP SDK: https://github.com/aws/aws-sdk-php/blob/master/tests/UsesServiceTrait.php

not sure that is important, thought its worth mentioning

Copy link
Contributor Author

Choose a reason for hiding this comment

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

its now a modified subset of that file

@bobstrecansky
Copy link
Contributor

Thank you @rtreffler! Once you've signed the CLA we'll be able to review and merge.

@codecov
Copy link

codecov bot commented Feb 5, 2025

Codecov Report

Attention: Patch coverage is 97.22222% with 1 line in your changes missing coverage. Please review.

Project coverage is 84.75%. Comparing base (c06b139) to head (e7c1000).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/Aws/src/AwsSdkInstrumentation.php 97.22% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #326      +/-   ##
============================================
+ Coverage     80.42%   84.75%   +4.32%     
+ Complexity     1502     1353     -149     
============================================
  Files           128      101      -27     
  Lines          6176     5627     -549     
============================================
- Hits           4967     4769     -198     
+ Misses         1209      858     -351     
Flag Coverage Δ
Aws 92.24% <97.22%> (+6.68%) ⬆️
Context/Swoole ?
Instrumentation/CakePHP ?
Instrumentation/CodeIgniter 73.77% <ø> (ø)
Instrumentation/Curl 90.42% <ø> (ø)
Instrumentation/ExtAmqp 89.26% <ø> (ø)
Instrumentation/ExtRdKafka 86.23% <ø> (ø)
Instrumentation/Guzzle 69.51% <ø> (ø)
Instrumentation/HttpAsyncClient 78.31% <ø> (ø)
Instrumentation/IO ?
Instrumentation/Laravel 62.68% <ø> (ø)
Instrumentation/MongoDB 74.28% <ø> (ø)
Instrumentation/MySqli 95.81% <ø> (ø)
Instrumentation/OpenAIPHP 87.31% <ø> (ø)
Instrumentation/PDO 90.15% <ø> (ø)
Instrumentation/Psr14 77.14% <ø> (ø)
Instrumentation/Psr15 89.41% <ø> (ø)
Instrumentation/Psr16 97.56% <ø> (ø)
Instrumentation/Psr18 77.77% <ø> (ø)
Instrumentation/Psr3 59.49% <ø> (ø)
Instrumentation/Psr6 ?
Instrumentation/Slim 86.30% <ø> (ø)
Instrumentation/Symfony 84.93% <ø> (ø)
Instrumentation/Yii 77.68% <ø> (ø)
Logs/Monolog 100.00% <ø> (ø)
Propagation/TraceResponse 100.00% <ø> (ø)
ResourceDetectors/Azure ?
ResourceDetectors/Container 93.02% <ø> (ø)
Sampler/RuleBased ?
Shims/OpenTracing 92.45% <ø> (ø)
Symfony 87.81% <ø> (ø)

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

Files with missing lines Coverage Δ
src/Aws/src/AwsSdkInstrumentation.php 94.91% <97.22%> (+46.83%) ⬆️

... and 27 files with indirect coverage changes


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 c06b139...e7c1000. Read the comment docs.

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

@rtreffler
Copy link
Contributor Author

Thank you @rtreffler! Once you've signed the CLA we'll be able to review and merge.

The company I'm currently working for is already working on the CLA topic.

…strumentation for the same client

Async calls would overwrite spans of different clients, so spl_object_has is used to keep span next to its client.
Also since we can instrument many clients via consecutive calls to `instrumentClient` and `activate` check is added to prevent duplicate middleware being added.
@rtreffler
Copy link
Contributor Author

Thank you for patience @bobstrecansky.
CLA is approved, conflicts resolved.

Removes unused methods in UsesServiceTrait.
@rtreffler
Copy link
Contributor Author

is there a chance we could progress with it this week ?

@brettmc brettmc merged commit 56e4005 into open-telemetry:main Mar 24, 2025
122 of 127 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.

3 participants