openzipkin / zipkin

Zipkin is a distributed tracing system
https://zipkin.io/
Apache License 2.0
17.01k stars 3.09k forks source link

Help wanted: make a zipkin PHP Tracer #1330

Closed codefromthecrypt closed 5 years ago

codefromthecrypt commented 8 years ago

Right now, there's no known supported PHP tracer that works with Zipkin.

There are a few sources of zipkin PHP code in the wild:

We are regularly asked about PHP, but we can't really recommend one unless it has a champion.

Options include:

Note that these aren't mutually exclusive, but a solid php zipkin-capable tracer is certainly the outcome. If you can champion this, please reply back and let us know which direction, for example, if you want a repo created.

Here are some contacts of interest:

Users who've expressed interest in a zipkin PHP tracer: @jamescway @loongmoon @rnavarro @dgafka @beberlei Those who've contributed to existing OSS existing php zipkin work: @Jimdo @brzuchal @asfan @malakaw @ralphiech Those who've written in-house php tracers: unknown

dgafka commented 8 years ago

Hello,
I was about to take a challenge of implementing OpenTracing in PHP and later add adapter for zipkin.
But currently, I've really limited amount of free time. So as much as I would love to have such solution in PHP, I am not able to develop it in the nearest time.

ralphiech commented 8 years ago

Hey guys, I am currently checking if I will be able to spend some more time to extend (add a scribe receiver) and probably mainly document (write a how to use / example readme) to the https://github.com/getyourguide/zipper library. We might also be able to register it with https://packagist.org/ for easy integration.

@adriancole what are the main features you need a 'champion' to support? or in other words what are the above libraries missing, what would you like to see happening here?

basvanbeek commented 8 years ago

I would say the most important features of a champion would be:

eirslett commented 8 years ago

I agree to these points ^^

Also if the API is similar to other tracers (Finagle, zipkin-js, Brave etc.) then it's easier to reason about it. Similar naming conventions, maybe even similar names of public methods in the API/library?

Also, unit tests are important (PHPUnit). And a build script, to generate thrift files, run the tests etc.

Maybe, similar to Brave and zipkin-js, have a monorepo with all composer packages for Zipkin PHP, with one core package, one package per transport and one package per instrumentation. It takes some tweaking to make that work with composer, which assumes one package per repository (I think)

sroze commented 8 years ago

I'm also really interested by a Zipkin tracer in PHP and already wrote one, private at the moment. An interesting amount of work have already been done on Tolrance and will add a Zipkin MessageProfile storage in the next couple of days!

drefined commented 8 years ago

@adriancole I'm trying to start a simple php library for zipkin, inspired from Tolerance and Hoopak. It doesn't have much now, but it can be used to send spans to Zipkin.

https://github.com/drefined/php-zipkin

sroze commented 8 years ago

@drefined as we can already do that with Tolerance (everything in the Tracer is framework-agnostic), would it be better to just improve the documentation and add extension points if needed?

drefined commented 8 years ago

@sroze, I like the idea of Tolerance, but ideally I would like to have a "pure" zipkin library. If you want to break out the zipkin piece from Tolerance and have that in a separate repo, I'd be interested in helping out with documentation and feature implementation.

sroze commented 8 years ago

@drefined I would like to split the components into read-only repositories, the same way Symfony is doing for instance. What would you like to see in this "Zipkin-only" library then? Only the models and the clients? If last question's answer is yes, what about splitting Tracer's component?

drefined commented 8 years ago

@sroze, I currently have a single repo with everything related to zipkin for php, but I think it should be broken out into several different repos: model/transport/client as one, framework / library specific instrumentation (laravel, symfony, redis, pdo, http) as separate repos, etc. Also, what do you mean by splitting Tracer's component?

sroze commented 8 years ago

@drefined https://github.com/Tolerance/Tolerance/tree/master/src/Tolerance/Tracer

drefined commented 8 years ago

@sroze, Ah, yes. I think the factory stuff could be broken out into its own repos. I don't think everyone would need that with the models/clients unless they are integrating it with Symfony or Laravel. I see the models/clients as the "base" then people could use that to build wrappers or integrations into other frameworks or libraries.

sroze commented 8 years ago

I used to advocate the many-repository architecture but I'm not anymore, as the dependencies are mostly dev dependencies and the users can pick what they want without installing 10 different packages. Tho, the HttpFondation factory can probably be moved to the Symfony bridge and the Psr7 factory to a Psr7 bridge, I'll do that when adding the AMQP factory later today.

codefromthecrypt commented 7 years ago

noticed @drefined has been cranking out some code (there's also some unmerged work on forks) https://github.com/drefined/php-zipkin

codefromthecrypt commented 7 years ago

here's another I just noticed https://github.com/mc0/php-zipkin

codefromthecrypt commented 7 years ago

here's another https://github.com/whitemerry/phpkin

whitemerry commented 7 years ago

@adriancole I'm releasing today first full version of phpkin with, i think, full support of all zipkin's features.

Project does not require any dependencies, and is as simple as it can be. So, to all PHP developers - take a look at code and tell me if you need something more. :)

codefromthecrypt commented 7 years ago

Thanks for the update. As far as recommending goes, I wouldnt recommend a library that writes trace data to log file as its primary interface.

This is a confusing optimization as it adds burden to those getting started. Can you add an http option like others have?

On 7 May 2017 07:51, "Piotr Bugaj" notifications@github.com wrote:

@adriancole https://github.com/adriancole I'm releasing today first full version of phpkin with, i think, full support of all zipkin's features.

Project does not require any dependencies, and is as simple as it can be. So, to all PHP developers - take a look at code and tell me if you need something more. :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openzipkin/zipkin/issues/1330#issuecomment-299672961, or mute the thread https://github.com/notifications/unsubscribe-auth/AAD61wW1Za69EtKGJdCWsY0TFNFTnAO5ks5r3QdlgaJpZM4KPdmt .

whitemerry commented 7 years ago

@adriancole Added http option, and released new version - https://github.com/whitemerry/phpkin/releases/tag/1.2

codefromthecrypt commented 7 years ago

thx!

jcchavezs commented 7 years ago

I just released this https://github.com/jcchavezs/zipkin-php

codefromthecrypt commented 6 years ago

@jcchavezs has continued efforts with symfony integration https://github.com/jcchavezs/zipkin-instrumentation-symfony. His tracer is very feature rich and easy to understand (for me anyway).

One thing I'd like to see is more folks collaborating on whatever solution ends up being the formal one for zipkin, if such ever happens. zipkin-php is doing well, folks opening issues and commenting, but still single-author. Is anyone available to partner up with more hands-on with @jcchavezs?

jcchavezs commented 5 years ago

We have an official PHP library so we can close this issue :p.