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
Zipkin receiver in SkyWalking collector #1273
Conversation
…put some doc for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the dequeue coding for the span cache?
* | ||
*/ | ||
|
||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate apache license header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it
|
||
List<ZipkinSpan> spans = gson.fromJson(br, spanListType); | ||
spans.forEach(span -> | ||
CacheFactory.INSTANCE.get(config).addSpan(span) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
INSTANCE variable was synchronized -> addSpan method is single threaded -> SpanJettyHandler is single threaded.
Is my understanding correct?
@peng-yongsheng This pr is Work In Progress. Open this to keep you posted. Transform codes are still on going. When you process data in stack, you didn't bother concurrency issue when you use local variables. For cached trace and spans, #AddSpan method has a reentrancelock to protect. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for scoping this out. main comment is maybe re-use the zipkin main jar as it is less than 200KiB and has no dependencies. This can provide the model and codec operations. Maybe this can help? https://github.com/openzipkin/zipkin/blob/master/zipkin-junit/src/main/java/zipkin/junit/ZipkinDispatcher.java#L88
try { | ||
BufferedReader br = req.getReader(); | ||
|
||
List<ZipkinSpan> spans = gson.fromJson(br, spanListType); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious.. instead of defining the same model here and also gson decoding.. why not depend on io.zipkin.zipkin2:zipkin and use SpanBytesDecoder? you will get proto3 format for free this way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adriancole I will try to switch to it today. I just don't know, haha. Sorry.
@adriancole Done. I am moving on. |
I am not using any explicit or manual dequeue. I am using the expired mechanism. See |
…nse text. All Apache 2.0 LICENSE files will be removed before beta2 release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so far so good
…OsInfo instead of String. 2. Try to regester application code and instance id in receiving spans.
thermodynamicCountOfResponseTimeSteps: 40 | ||
# TODO: receiver_zipkin need to remove before merge, and only provide this in document. | ||
receiver_zipkin: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary to pass this information being structured? Can't you just pass the endpoint
(e.g. endpoint: http://localhost:9411/api/v2/spans
as we usually do for zipkin? cc @adriancole @wu-sheng
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which parts do you refer? receiver_zipkin
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jcchavezs I guess you mean, ip, port, context path, servlet mapping path, etc. That is because I don't use an URL util to analysis the endpoint string. Does Zipkin do this by providing an URL endpoint only? If this is a tradition, I can follow that.
we pass the full url when specifying config for clients (in case it is
remapped by a proxy). since this is a server suppose it doesn't matter. for
example zipkin's server doesn't use a url style to indicate the listen
info, rather it allows you only to change the port. how you handle things
here is up to you I think.
|
… analysis module. Wait for further tests.
…improve in another PR.
I finish the prototype of this feature. Here is how people to test this:
Right now, I use Caffeine as an expire checker, and it doesn't work well. So just ignore the following errors. Just access Spring Sleuth more than once. I usually set a timer in browser. I intend to replace Caffeine.
|
I tested and only tested by basic sleuth example: https://github.com/openzipkin/sleuth-webmvc-example So, I intend to merge this if this is passed. Here are my screenshots. Then I will work on more about new expire mechanism, cluster mode and more zipkin examples. |
first cut works.. well done! I'll review closely more easily later as my workspace is all sorted etc |
Yes. Do a lot of assumptions in the transfer. Need Zipkin community to confirm. Of course, we can improve them in the further test. I will try more cases :) |
if (applicationCode != null) { | ||
int applicationId = registerServices.getApplicationIDService().getOrCreateForApplicationCode(applicationCode); | ||
if (applicationId != 0) { | ||
registerServices.getOrCreateApplicationInstanceId(applicationId, applicationCode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use applicationCode instead of UUID will let all the instance in same application to be a single one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but do you have new idea? Zipkin has no specific tag for instance. No such concept.
in general, things not defined (which many things are not) simply go into
the relevant namespace. ex skywalking.application-id or similar
|
Dear @peng-yongsheng @ascrutae @candyleer @liuhaoyang @adriancole @basvanbeek @jcchavezs,
I am working on this pull request, which is about receiving and analysis Zipkin trace. I paste the REAMDE doc of this module at here, to give everyone a brief:
Zipkin receiver
Zipkin receiver provides the feature to receive span data from Zipkin instrumented applications. SkyWalking backend provides
analysis, aggregation and visualization. So the user will not need to learn how SkyWalking auto instrumentation
agents(Java, .NET, node.js) work, or they don't want to change for some reasons, such as Zipkin integration has been completed.
Zipkin receiver is only an optional features in SkyWalking, even now it is an incubating feature.
Limits
As an incubating feature, it is a prototype. So it has following limits:
Right now(28th, May.), I just finished my codes with following features:
/api/v2/spans
serviceI want to ask any one who has time, interest and is familiar with Zipkin format, especially @adriancole @basvanbeek @jcchavezs , to check whether I miss anything for a zipkin v2 json format.
The next I am going to do is:
After trace finished, analysis the whole trace(spans), transfer them to TraceSegment based on its tree structure and localendpoint/serviceName as application code.
For milestone, in beta2, I will definitely consider this as an incubating feature only. Wait for me or someone else to change the local cache implementor to Redis(cluster) based in 5.1.x series, maybe.