Skip to content

Conversation

@piotrantosik
Copy link
Contributor

Hi, I add more Symfony instrumentation improvements:

  • more tests
  • make classes final
  • calculate content length if header doesn't exist

Big clap for your work, all works perfect 🎉

@piotrantosik piotrantosik requested a review from a team February 25, 2023 18:23
@codecov
Copy link

codecov bot commented Feb 25, 2023

Codecov Report

Merging #120 (f82578b) into main (6088a1c) will decrease coverage by 0.10%.
The diff coverage is 0.00%.

❗ Current head f82578b differs from pull request most recent head 1850948. Consider uploading reports for the commit 1850948 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #120      +/-   ##
============================================
- Coverage     52.82%   52.72%   -0.10%     
- Complexity      445      447       +2     
============================================
  Files            48       48              
  Lines          1683     1686       +3     
============================================
  Hits            889      889              
- Misses          794      797       +3     
Flag Coverage Δ
7.4 81.76% <ø> (ø)
8.0 59.42% <0.00%> (-0.12%) ⬇️
8.1 59.49% <0.00%> (-0.12%) ⬇️
8.2 52.64% <0.00%> (-0.10%) ⬇️

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

Impacted Files Coverage Δ
.../Instrumentation/Symfony/src/HeadersPropagator.php 0.00% <ø> (ø)
...rumentation/Symfony/src/SymfonyInstrumentation.php 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

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

$contentLength = $response->headers->get('Content-Length');
/** @psalm-suppress PossiblyFalseArgument */
//BinaryFileResponse and StreamedResponse return boolean as response
if (null === $contentLength && is_string($response->getContent())) {
Copy link
Member

Choose a reason for hiding this comment

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

Don't know if that may happen, but what in the case when Content-length header is not provided and $response->getContent() returns false ?
Otherwise LGTM.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's set null as before - default value for $response->headers->get(), I added tests that cover this case and also removed some redundant parameters.

Copy link
Member

Choose a reason for hiding this comment

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

I missed test. I was just thinking if it makes sense to set this attribute in this case

@pdelewski pdelewski merged commit 878b348 into open-telemetry:main Feb 27, 2023
@piotrantosik piotrantosik deleted the ft/symfony-tests branch February 27, 2023 07:55
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