Skip to content

Fix compatibility with Zipkin 3 #37

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 28, 2021
Merged

Fix compatibility with Zipkin 3 #37

merged 1 commit into from
Oct 28, 2021

Conversation

adiachenko
Copy link
Collaborator

@adiachenko adiachenko commented Oct 26, 2021

#34 introduced PHP 8 support which requires Zipkin PHP v3.

However, due to slight difference in contracts the package can't instantiate the Http reporter:

PHP Fatal error:  Uncaught TypeError: Zipkin\Reporters\Http::__construct(): Argument #1 ($options) must be of type array, null given, called in /opt/project/vendor/vinelab/tracing-laravel/src/Drivers/Zipkin/ZipkinTracer.php on line 325 and defined in /opt/project/vendor/openzipkin/zipkin/src/Zipkin/Reporters/Http.php:52
Stack trace:

It seems like the suggested order of parameters was changed back in v2, but it didn't become an issue due to additional layer of compatibility checks which are now removed. This will now work for both v2 and v3.

@adiachenko adiachenko added the bug Something isn't working label Oct 26, 2021
@adiachenko adiachenko requested review from Mulkave and KinaneD October 26, 2021 20:28
@jcchavezs
Copy link
Contributor

jcchavezs commented Oct 26, 2021 via email

@adiachenko
Copy link
Collaborator Author

adiachenko commented Oct 26, 2021

@jcchavezs So, I originally thought the issue was an unintended consequence of lax version constraint ("openzipkin/zipkin": "~2.0.2|3.0.x-dev") on our end, but it seems to be something else which is why I updated original description.

Starting from v8.62.0 Laravel constrained the version of psr/log in its own composer.json to ^1.0 || ^2.0. If you create Laravel project now, your composer.lock will have your psr/log dependency locked to 2.0. Actually, if you follow the linked PR, they even suggest enforcing psr/log ^3.0 for Laravel 9.

This seems to conflict with Zipkin PHP that expects psr/log ^1.0.

For now, this can be solved by downgrading psr/log dependency manually in your project, but it's certainly a bit confusing.

I wonder if it would be possible to allow different versions of psr/log in Zipkin PHP.

@jcchavezs
Copy link
Contributor

jcchavezs commented Oct 27, 2021 via email

@adiachenko
Copy link
Collaborator Author

I am fine with upgrading psr/log in zipkin-php. Would you put up a PR with such change?

Sure, I'll submit one later today.

@adiachenko adiachenko merged commit 42b9788 into master Oct 28, 2021
@adiachenko adiachenko deleted the compatibility-fix branch October 28, 2021 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants