zipkin4net icon indicating copy to clipboard operation
zipkin4net copied to clipboard

Local Spans don't render correctly in Zipkin UI

Open aachinfiev opened this issue 7 years ago • 2 comments

This is a follow up based on Gitter chat with @adriancole

I have tested new release v1.1.0 which has corrected local span processing that @fedj put together. There is still an issue in how spans end up displayed in zipkin UI.

Sample code:

            var trace = m.Trace.Child();
            trace.Record(Annotations.ServerRecv());
            trace.Record(Annotations.ServiceName("child"));
            trace.Record(Annotations.Rpc("play"));
            Task.Delay(50).Wait();
            var local = trace.Child();
            local.Record(Annotations.LocalOperationStart("child-playing"));
            Task.Delay(100).Wait();
            local.Record(Annotations.LocalOperationStop());
            Task.Delay(70).Wait();

Shows up as: image

Server receives

[
    {
        "id": "14cfe1b594cf86e7",
        "name": "UnknownRpc",
        "binaryAnnotations": [
            {
                "key": "lc",
                "value": "child-playing",
                "endpoint": {
                    "ipv4": "-1062730697",
                    "port": "0",
                    "serviceName": ""
                }
            }
        ],
        "debug":False,
        "traceId": "6810abc3970a40dd",
        "timestamp": "1509149747045620",
        "duration": "108010",
        "parentId": "da12fcb02e772456"
    }
]

If I add RPC name as

            var local = trace.Child();
            local.Record(Annotations.Rpc("child-local"));
            local.Record(Annotations.LocalOperationStart("child-playing"));

Then it will show as

image

Server receives:

[
    {
        "id": "67a4860d7886cc8f",
        "name": "child-local",
        "binaryAnnotations": [
            {
                "key": "lc",
                "value": "child-playing",
                "endpoint": {
                    "ipv4": "-1062730697",
                    "port": "0",
                    "serviceName": ""
                }
            }
        ],
        "debug":False,
        "traceId": "5af6412661f3dddf",
        "timestamp": "1509150439885897",
        "duration": "1499149",
        "parentId": "13ea891fab7bc483"
    }
]

However it still doesn't look right. I think it should do one of the following so the spans appear more informative.

Option 1 - Using local operation without RPC annotation

In this case either left side should state operation name and right side be empty and only contain duration. Or left side is empty and right side contains operation name.

Option 2 - Using local operation + RPC annotation

In this case left side can show RPC as it does now and right side should show local operation instead of unknown RPC.

Option 3 - Whatever else that might make sense for this local span display.

Thank you,

Alex

aachinfiev avatar Oct 28 '17 00:10 aachinfiev

Hi Alex,

Did you ever find the best solution for this? I can confirm I can get this to work by adding the RPC annotation but even if I then use the local operation stop/start then the timings are not detailed when you click on the span: screen shot 2019-01-31 at 11 48 56

Dan-Coleman avatar Jan 31 '19 11:01 Dan-Coleman

@sphinxy wondering if you have cycles to help support the project. this is an example of a problem that needs some help

codefromthecrypt avatar Jan 31 '19 14:01 codefromthecrypt