Skip to content
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

UI: Collecting Spans with no annotations crashes the UI #1278

Closed
rogeralsing opened this issue Sep 8, 2016 · 8 comments
Closed

UI: Collecting Spans with no annotations crashes the UI #1278

rogeralsing opened this issue Sep 8, 2016 · 8 comments
Labels

Comments

@rogeralsing
Copy link
Member

If you collect a root span with no annotations on (which is ofcourse incorrect) the UI breaks with a null reference exception at the find trace screen, and thus making it impossible to find any trace at all.

This is ofc an edgecase that souldnt occur, but if someone sends corrupt data to Zipkin, it would be nice if things continue to work as expected.

@cburroughs
Copy link
Contributor

I'm unsure how to reproduce this. I tried synthesizing a trace with the root span:

  {
    "traceId": "1b0c8b7d5a4a4632a8462d044d2fffff",
    "id": "81d0a94237ae54de",
    "name": "foo",
    "timestamp": 1481324510534000,
    "duration": 21272000,
    "annotations": [
    ],
    "binaryAnnotations": [
    ]
  },

But did not get errors when searching for it.

@codefromthecrypt
Copy link
Member

in zipkin v1 we have to have at least one annotation or binary annotation as that's where the servicename is sourced from. If you could help with model v2 support we could get it in much quicker.. lemme know #939 (comment)

@codefromthecrypt
Copy link
Member

ps (does this literally crash or just doesn't show up?)

@bkleef
Copy link

bkleef commented May 3, 2017

@adriancole this is still the case with version 1.23.3. As you can see we only set binaryAnnotations possibly because we use https://github.com/openzipkin/zipkin-go-opentracing.

On browser console we get a JS error:

EXCEPTION: this.root.annotations is undefined

Response:

[
   [
      {
         "traceId":"414e44fb181df47e6ec3273cd5e68c13",
         "id":"48f69e22bceb3828",
         "name":"com.example.srv.time.transport.getlist",
         "timestamp":1493817271284756,
         "duration":10181,
         "binaryAnnotations":[
            {
               "key":"lc",
               "value":"com.example.api.v1.time",
               "endpoint":{
                  "serviceName":"com.example.api.v1.time",
                  "ipv4":"127.0.0.1"
               }
            }
         ],
         "debug":true
      },
      {
         "traceId":"414e44fb181df47e6ec3273cd5e68c13",
         "id":"7b6b5f79a727456e",
         "name":"com.example.srv.time.transport.getlist",
         "parentId":"48f69e22bceb3828",
         "timestamp":1493817271292233,
         "duration":1703,
         "binaryAnnotations":[
            {
               "key":"lc",
               "value":"com.example.srv.time",
               "endpoint":{
                  "serviceName":"com.example.srv.time",
                  "ipv4":"127.0.0.1"
               }
            }
         ],
         "debug":true
      }
   ],
   [
      {
         "traceId":"6022cde94bff790803ccfec040a020d6",
         "id":"62f37b8ddfb2c9d0",
         "name":"com.example.srv.time.transport.getlist",
         "timestamp":1493817222041547,
         "duration":12139,
         "binaryAnnotations":[
            {
               "key":"lc",
               "value":"com.example.api.v1.time",
               "endpoint":{
                  "serviceName":"com.example.api.v1.time",
                  "ipv4":"127.0.0.1"
               }
            }
         ],
         "debug":true
      },
      {
         "traceId":"6022cde94bff790803ccfec040a020d6",
         "id":"735f5fdd1cf20628",
         "name":"com.example.srv.time.transport.getlist",
         "parentId":"62f37b8ddfb2c9d0",
         "timestamp":1493817222050620,
         "duration":2124,
         "binaryAnnotations":[
            {
               "key":"lc",
               "value":"com.example.srv.time",
               "endpoint":{
                  "serviceName":"com.example.srv.time",
                  "ipv4":"127.0.0.1"
               }
            }
         ],
         "debug":true
      }
   ],
   [
      {
         "traceId":"70cdb97b817d2d5069da6015f1b58242",
         "id":"4824ed25b2ce7b68",
         "name":"com.example.srv.time.transport.getlist",
         "timestamp":1493817220184318,
         "duration":10554,
         "binaryAnnotations":[
            {
               "key":"lc",
               "value":"com.example.api.v1.time",
               "endpoint":{
                  "serviceName":"com.example.api.v1.time",
                  "ipv4":"127.0.0.1"
               }
            }
         ],
         "debug":true
      },
      {
         "traceId":"70cdb97b817d2d5069da6015f1b58242",
         "id":"427c20a173159005",
         "name":"com.example.srv.time.transport.getlist",
         "parentId":"4824ed25b2ce7b68",
         "timestamp":1493817220191750,
         "duration":2071,
         "binaryAnnotations":[
            {
               "key":"lc",
               "value":"com.example.srv.time",
               "endpoint":{
                  "serviceName":"com.example.srv.time",
                  "ipv4":"127.0.0.1"
               }
            }
         ],
         "debug":true
      }
   ],
   [
      {
         "traceId":"4633b79f27358e0a4a668a87dd6db8f6",
         "id":"5d0e401ceb6199b1",
         "name":"com.example.srv.time.transport.getlist",
         "timestamp":1493816987763840,
         "duration":17246,
         "binaryAnnotations":[
            {
               "key":"lc",
               "value":"com.example.api.v1.time",
               "endpoint":{
                  "serviceName":"com.example.api.v1.time",
                  "ipv4":"127.0.0.1"
               }
            }
         ],
         "debug":true
      },
      {
         "traceId":"4633b79f27358e0a4a668a87dd6db8f6",
         "id":"099b6f99a3d302fc",
         "name":"com.example.srv.time.transport.getlist",
         "parentId":"5d0e401ceb6199b1",
         "timestamp":1493816987773581,
         "duration":6534,
         "binaryAnnotations":[
            {
               "key":"lc",
               "value":"com.example.srv.time",
               "endpoint":{
                  "serviceName":"com.example.srv.time",
                  "ipv4":"127.0.0.1"
               }
            }
         ],
         "debug":true
      }
   ],
   [
      {
         "traceId":"77bd870f0f9937eb1921da490b61a621",
         "id":"42c74cfe6ff12b92",
         "name":"com.example.srv.time.transport.getlist",
         "timestamp":1493816987572696,
         "duration":11595,
         "binaryAnnotations":[
            {
               "key":"lc",
               "value":"com.example.api.v1.time",
               "endpoint":{
                  "serviceName":"com.example.api.v1.time",
                  "ipv4":"127.0.0.1"
               }
            }
         ],
         "debug":true
      },
      {
         "traceId":"77bd870f0f9937eb1921da490b61a621",
         "id":"34de313496a58702",
         "name":"com.example.srv.time.transport.getlist",
         "parentId":"42c74cfe6ff12b92",
         "timestamp":1493816987580616,
         "duration":2552,
         "binaryAnnotations":[
            {
               "key":"lc",
               "value":"com.example.srv.time",
               "endpoint":{
                  "serviceName":"com.example.srv.time",
                  "ipv4":"127.0.0.1"
               }
            }
         ],
         "debug":true
      }
   ],
   [
      {
         "traceId":"12c36c4ed14fd71520afcc13d5d4afc3",
         "id":"5351db552b8ef348",
         "name":"com.example.srv.time.transport.getlist",
         "timestamp":1493816984668362,
         "duration":17917,
         "binaryAnnotations":[
            {
               "key":"lc",
               "value":"com.example.api.v1.time",
               "endpoint":{
                  "serviceName":"com.example.api.v1.time",
                  "ipv4":"127.0.0.1"
               }
            }
         ],
         "debug":true
      },
      {
         "traceId":"12c36c4ed14fd71520afcc13d5d4afc3",
         "id":"4fa53a43d7320099",
         "name":"com.example.srv.time.transport.getlist",
         "parentId":"5351db552b8ef348",
         "timestamp":1493816984681105,
         "duration":3786,
         "binaryAnnotations":[
            {
               "key":"lc",
               "value":"com.example.srv.time",
               "endpoint":{
                  "serviceName":"com.example.srv.time",
                  "ipv4":"127.0.0.1"
               }
            }
         ],
         "debug":true
      }
   ]
]

@basvanbeek
Copy link
Member

basvanbeek commented May 3, 2017

zipkin-go-opentracing does not force you to do binary annotations only.

If you want to annotate a span as a RPC client node calling some service, you should use: ext.SpanKindRPCClient.Set(span) on the span.

If you want to annotate a span as a RPC server node receiving an incoming request, you should extract the B3 headers propagating the client side span with tracer.Extract() after which you create the server side span feeding it the received wirecontext tracer.StartSpan("operationName", ext.RPCServerOption(wireContext)) which can be seen in the example middleware:
https://github.com/openzipkin/zipkin-go-opentracing/blob/master/examples/middleware/http.go#L74

If you are doing internal local component spans you can use the logic as seen here: https://github.com/openzipkin/zipkin-go-opentracing/blob/master/examples/cli_with_2_services/svc2/implementation.go#L53 where doing a timestamped LC annotation by invoking ext.SpanKind.Set(span, "resource") or do a span.LogEvent("lc") or span.LogEvent(zipkincore.LOCAL_COMPONENT) which is more native to Zipkin.

@bkleef
Copy link

bkleef commented May 3, 2017

@basvanbeek thanks a lot for your feedback. We will look into it.

IMHO it's still a bad thing that the new Zipkin UI crashes (only services are displayed in "Service" dropdown but no traces are shown while they are visualized in old UI) when annotations is missing in JSON response. Especially because old UI can handle this.

@codefromthecrypt
Copy link
Member

codefromthecrypt commented May 4, 2017 via email

@codefromthecrypt
Copy link
Member

This issue was moved to openzipkin-attic/zipkin-ui#40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants