zipkin-browser-extension icon indicating copy to clipboard operation
zipkin-browser-extension copied to clipboard

client-side annotations

Open codefromthecrypt opened this issue 8 years ago • 2 comments

We're currently tagging outbound requests with a trace/span id. I wonder if we can configure a zipkin url and post json of the client-side of the trace?

codefromthecrypt avatar Apr 13 '16 14:04 codefromthecrypt

I'm not sure I understand what you mean...?

eirslett avatar Apr 13 '16 15:04 eirslett

In the current code, before we send a request, we add the trace id, like X-B3-TraceId: 9d30188d40a191d3. Let's say we started a stopwatch at the same time. If we added a hook after receiving the response, we could post the following to zipkin /api/v1/spans

[
{
  "traceId": "9d30188d40a191d3",
  "name": "get",
  "id": "9d30188d40a191d3",
  "timestamp": START_MICROS,
  "duration": END_MICROS-START_MICROS,
  "annotations": [
    {
      "endpoint": {
        "serviceName": "zipkin-chrome-extension",
        "ipv4": "MY_IP"
      },
      "timestamp": START_MICROS,
      "value": "cs"
    },
    {
      "endpoint": {
        "serviceName": "zipkin-chrome-extension",
        "ipv4": "MY_IP"
      },
      "timestamp": END_MICROS,
      "value": "cr"
    }
  ]
}
]

Obviously, we could batch up spans and post them at the same time, etc.

codefromthecrypt avatar Apr 13 '16 16:04 codefromthecrypt