{"action":"created","issue":{"url":"https://api.github.com/repos/openzipkin/zipkin/issues/939","repository_url":"https://api.github.com/repos/openzipkin/zipkin","labels_url":"https://api.github.com/repos/openzipkin/zipkin/issues/939/labels{/name}","comments_url":"https://api.github.com/repos/openzipkin/zipkin/issues/939/comments","events_url":"https://api.github.com/repos/openzipkin/zipkin/issues/939/events","html_url":"https://github.com/openzipkin/zipkin/issues/939","id":131157141,"number":939,"title":"Zipkin v2 span model","user":{"login":"adriancole","id":64215,"avatar_url":"https://avatars.githubusercontent.com/u/64215?v=3","gravatar_id":"","url":"https://api.github.com/users/adriancole","html_url":"https://github.com/adriancole","followers_url":"https://api.github.com/users/adriancole/followers","following_url":"https://api.github.com/users/adriancole/following{/other_user}","gists_url":"https://api.github.com/users/adriancole/gists{/gist_id}","starred_url":"https://api.github.com/users/adriancole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriancole/subscriptions","organizations_url":"https://api.github.com/users/adriancole/orgs","repos_url":"https://api.github.com/users/adriancole/repos","events_url":"https://api.github.com/users/adriancole/events{/privacy}","received_events_url":"https://api.github.com/users/adriancole/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2016-02-03T21:19:57Z","updated_at":"2016-12-01T04:36:29Z","closed_at":null,"body":"We should not try to do all things as zipkin v2.. the large amount of interesting things may lead us to never even start. I believe that if we pare down do basics, creating a model that only includes features that work in zipkin 1 backends, we can start and finish something.\n\nFor example, zipkin 1 only really supports String -> String binary annotations.. let's make them String -> String for v2 even if they become fancy later.\n\nZipkin v1 allows \"contributory\" spans, where instrumentation are allowed to place multiple hosts into the same span. Let's prevent that, and use a portability technique google cloud trace does. Google Cloud Trace allows multiple spans with the same id, but they vary on span.kind. For example, core server annotations really imply a span.kind=server, where \"sr\" is span.startTs and \"ss\" is span.endTs.\n\nWe could probably literally use the google cloud trace model as zipkin v2 as it is almost exactly what we need.\n\nhttps://cloud.google.com/trace/api/reference/rest/v1/projects.traces#TraceSpan\n\nIf we do something like this, I'm confident we can get v2 out in relatively short order, and still not prevent more interesting (and severe) change from occurring in later versions of zipkin.\n"},"comment":{"url":"https://api.github.com/repos/openzipkin/zipkin/issues/comments/264076909","html_url":"https://github.com/openzipkin/zipkin/issues/939#issuecomment-264076909","issue_url":"https://api.github.com/repos/openzipkin/zipkin/issues/939","id":264076909,"user":{"login":"adriancole","id":64215,"avatar_url":"https://avatars.githubusercontent.com/u/64215?v=3","gravatar_id":"","url":"https://api.github.com/users/adriancole","html_url":"https://github.com/adriancole","followers_url":"https://api.github.com/users/adriancole/followers","following_url":"https://api.github.com/users/adriancole/following{/other_user}","gists_url":"https://api.github.com/users/adriancole/gists{/gist_id}","starred_url":"https://api.github.com/users/adriancole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adriancole/subscriptions","organizations_url":"https://api.github.com/users/adriancole/orgs","repos_url":"https://api.github.com/users/adriancole/repos","events_url":"https://api.github.com/users/adriancole/events{/privacy}","received_events_url":"https://api.github.com/users/adriancole/received_events","type":"User","site_admin":false},"created_at":"2016-12-01T04:36:29Z","updated_at":"2016-12-01T04:36:29Z","body":"Examples will help a lot. here's a literal translation of an existing client span into the proposed simplified format. Note: on subtle change is suffixing micros to our units. This helps with things like logstash etc which expect timestamps to be milllis or otherwise (meaning you can add a normal timestamp without clashing!)\r\n\r\ncurrent\r\n```json\r\n{\r\n  \"traceId\": \"5af7183fb1d4cf5f\",\r\n  \"name\": \"query\",\r\n  \"id\": \"352bff9a74ca9ad2\",\r\n  \"parentId\": \"6b221d5bc9e6496c\",\r\n  \"timestamp\": 1461750040359000,\r\n  \"duration\": 5000,\r\n  \"annotations\": [\r\n    {\r\n      \"endpoint\": {\r\n        \"serviceName\": \"zipkin-server\",\r\n        \"ipv4\": \"172.19.0.3\",\r\n        \"port\": 9411\r\n      },\r\n      \"timestamp\": 1461750040359000,\r\n      \"value\": \"cs\"\r\n    },\r\n    {\r\n      \"endpoint\": {\r\n        \"serviceName\": \"zipkin-server\",\r\n        \"ipv4\": \"172.19.0.3\",\r\n        \"port\": 9411\r\n      },\r\n      \"timestamp\": 1461750040364000,\r\n      \"value\": \"cr\"\r\n    }\r\n  ],\r\n  \"binaryAnnotations\": [\r\n    {\r\n      \"key\": \"jdbc.query\",\r\n      \"value\": \"select distinct `zipkin_spans`.`trace_id` from `zipkin_spans` join `zipkin_annotations` on (`zipkin_spans`.`trace_id` = `zipkin_annotations`.`trace_id` and `zipkin_spans`.`id` = `zipkin_annotations`.`span_id`) where (`zipkin_annotations`.`endpoint_service_name` = ? and `zipkin_spans`.`start_ts` between ? and ?) order by `zipkin_spans`.`start_ts` desc limit ?\",\r\n      \"endpoint\": {\r\n        \"serviceName\": \"zipkin-server\",\r\n        \"ipv4\": \"172.19.0.3\",\r\n        \"port\": 9411\r\n      }\r\n    },\r\n    {\r\n      \"key\": \"sa\",\r\n      \"value\": true,\r\n      \"endpoint\": {\r\n        \"serviceName\": \"mysql\",\r\n        \"ipv4\": \"172.19.0.2\",\r\n        \"port\": 3306\r\n      }\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\nsimplified\r\n```json\r\n{\r\n  \"kind\": \"CLIENT\",\r\n  \"traceId\": \"5af7183fb1d4cf5f\",\r\n  \"parentId\": \"6b221d5bc9e6496c\",\r\n  \"id\": \"352bff9a74ca9ad2\",\r\n  \"name\": \"query\",\r\n  \"timestampMicros\": 1461750040359000,\r\n  \"durationMicros\": 5000,\r\n  \"localService\": {\r\n    \"serviceName\": \"zipkin-server\",\r\n    \"ipv4\": \"172.19.0.3\",\r\n    \"port\": 9411\r\n  },\r\n  \"peerService\": {\r\n    \"serviceName\": \"mysql\",\r\n    \"ipv4\": \"172.19.0.2\",\r\n    \"port\": 3306\r\n  },\r\n  \"tags\": {\r\n    \"jdbc.query\": \"select distinct `zipkin_spans`.`trace_id` from `zipkin_spans` join `zipkin_annotations` on (`zipkin_spans`.`trace_id` = `zipkin_annotations`.`trace_id` and `zipkin_spans`.`id` = `zipkin_annotations`.`span_id`) where (`zipkin_annotations`.`endpoint_service_name` = ? and `zipkin_spans`.`start_ts` between ? and ?) order by `zipkin_spans`.`start_ts` desc limit ?\"\r\n  }\r\n}\r\n```"}}
{"actor":{"display_login":"adriancole"}}