open-telemetry / opentelemetry-php

The OpenTelemetry PHP Library
https://opentelemetry.io/docs/instrumentation/php/
Apache License 2.0
716 stars 178 forks source link

handle empty encoded responses #1337

Closed brettmc closed 3 months ago

brettmc commented 3 months ago

at least one otel backend product sends an empty response with a gzip encoding, which we fail to decode (because an empty string is not valid). Work around this by not trying to decode an empty value.

Fixes: #1264

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 74.43%. Comparing base (6bf422c) to head (393a609).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1337/graphs/tree.svg?width=650&height=150&src=pr&token=OE661REHqm&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry)](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1337?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) ```diff @@ Coverage Diff @@ ## main #1337 +/- ## ============================================ + Coverage 74.38% 74.43% +0.04% - Complexity 2493 2494 +1 ============================================ Files 354 354 Lines 7144 7146 +2 ============================================ + Hits 5314 5319 +5 + Misses 1830 1827 -3 ``` | [Flag](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1337/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | Coverage Δ | | |---|---|---| | [8.1](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1337/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `74.12% <100.00%> (+0.10%)` | :arrow_up: | | [8.2](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1337/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `74.26% <100.00%> (+0.03%)` | :arrow_up: | | [8.3](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1337/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `74.29% <100.00%> (-0.01%)` | :arrow_down: | | [8.4](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1337/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | `74.26% <100.00%> (+0.07%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1337?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) | Coverage Δ | | |---|---|---| | [src/SDK/Common/Export/Http/PsrUtils.php](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1337?src=pr&el=tree&filepath=src%2FSDK%2FCommon%2FExport%2FHttp%2FPsrUtils.php&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry#diff-c3JjL1NESy9Db21tb24vRXhwb3J0L0h0dHAvUHNyVXRpbHMucGhw) | `92.64% <100.00%> (+0.22%)` | :arrow_up: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1337/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1337?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1337?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry). Last update [6bf422c...393a609](https://app.codecov.io/gh/open-telemetry/opentelemetry-php/pull/1337?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=open-telemetry).