openzipkin-attic / zipkin-azure

Reporters and collectors for use in Azure
Apache License 2.0
11 stars 9 forks source link

Accepts zipkin2 json span format #37

Closed codefromthecrypt closed 7 years ago

codefromthecrypt commented 7 years ago

This uses the recently released detecting decoder to support the new Span2 format defined in https://github.com/openzipkin/zipkin/issues/1499

codefromthecrypt commented 7 years ago

verified with an ad-hoc client:

  @Test
  public void test() throws Exception {
    EventData sendEvent = new EventData(("[{\n"
        + "  \"traceId\": \"86154a4ba6e91388\",\n"
        + "  \"id\": \"86154a4ba6e91387\",\n"
        + "  \"kind\": \"SERVER\",\n"
        + "  \"name\": \"get\",\n"
        + "  \"timestamp\": 1502678423123456,\n"
        + "  \"duration\": 207000,\n"
        + "  \"localEndpoint\": {\n"
        + "    \"serviceName\": \"testservice\",\n"
        + "    \"ipv4\": \"113.210.108.10\"\n"
        + "  },\n"
        + "  \"tags\": {\n"
        + "    \"http.path\": \"/api/blah\"\n"
        + "  }\n"
        + "}]").getBytes(Util.UTF_8));

    String connectString = new ConnectionStringBuilder(
        "zipkin",
        "zipkin",
        "RootManageSharedAccessKey",
        "Aint Tellin"
    ).toString();
    EventHubClient.createFromConnectionStringSync(connectString).sendSync(sendEvent);
  }