{"action":"created","issue":{"url":"https://api.github.com/repos/Workiva/opentracing_dart/issues/20","repository_url":"https://api.github.com/repos/Workiva/opentracing_dart","labels_url":"https://api.github.com/repos/Workiva/opentracing_dart/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/Workiva/opentracing_dart/issues/20/comments","events_url":"https://api.github.com/repos/Workiva/opentracing_dart/issues/20/events","html_url":"https://github.com/Workiva/opentracing_dart/pull/20","id":339000482,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5Nzk0MzA2","number":20,"title":"Update Logging API to opentracing conventions","user":{"login":"toddbeckman-wf","id":16763404,"node_id":"MDQ6VXNlcjE2NzYzNDA0","avatar_url":"https://avatars3.githubusercontent.com/u/16763404?v=4","gravatar_id":"","url":"https://api.github.com/users/toddbeckman-wf","html_url":"https://github.com/toddbeckman-wf","followers_url":"https://api.github.com/users/toddbeckman-wf/followers","following_url":"https://api.github.com/users/toddbeckman-wf/following{/other_user}","gists_url":"https://api.github.com/users/toddbeckman-wf/gists{/gist_id}","starred_url":"https://api.github.com/users/toddbeckman-wf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toddbeckman-wf/subscriptions","organizations_url":"https://api.github.com/users/toddbeckman-wf/orgs","repos_url":"https://api.github.com/users/toddbeckman-wf/repos","events_url":"https://api.github.com/users/toddbeckman-wf/events{/privacy}","received_events_url":"https://api.github.com/users/toddbeckman-wf/received_events","type":"User","site_admin":false},"labels":[{"id":644665457,"node_id":"MDU6TGFiZWw2NDQ2NjU0NTc=","url":"https://api.github.com/repos/Workiva/opentracing_dart/labels/Merge%20Requirements%20Unmet","name":"Merge Requirements Unmet","color":"e11d21","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-07-06T16:32:18Z","updated_at":"2018-07-06T19:04:01Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/Workiva/opentracing_dart/pulls/20","html_url":"https://github.com/Workiva/opentracing_dart/pull/20","diff_url":"https://github.com/Workiva/opentracing_dart/pull/20.diff","patch_url":"https://github.com/Workiva/opentracing_dart/pull/20.patch"},"body":"# Description\r\n\r\nThe Log API is out of date with opentracing logging conventions. See issue https://github.com/Workiva/opentracing_dart/issues/4. In addition to matching the API of other open tracing languages such as opentracing_go, this allows named key-value fields for consumers to add custom structured metadata rather than relying on the untyped `payload`.\r\n\r\nSee: https://github.com/opentracing/specification/blob/master/semantic_conventions.md#log-fields-table\r\n\r\n## Summary Of API Changes\r\n\r\n### `LogData` constructor\r\n\r\nUpdates to remove `payload` and adds a `fields` parameter for named payloads in addition to other optional parameters based on the conventional keys.\r\n\r\n```diff\r\nclass LogData {\r\n- LogData(this.timestamp, this.event, this.payload);\r\n+ LogData(String event, {\r\n     DateTime timestamp,\r\n+    String errorKind,\r\n+    dynamic errorObject,\r\n+    String message,\r\n+    StackTrace stackTrace,\r\n+    Map<String, dynamic> fields: const {},\r\n-    this.payload,\r\n+  })\r\n}\r\n```\r\n\r\nAdds getters for the standard keys and removes `payload`:\r\n\r\n```diff\r\nclass LogData {\r\n   String event\r\n+  Map<String, dynamic> fields;\r\n+  String get errorKind => fields[LogField.errorKind];\r\n+  String get message;\r\n+  StackTrace get stackTrace;\r\n+  dynamic get errorObject;\r\n-  dynamic payload;\r\n}\r\n```\r\n\r\n### `Span.log`\r\n\r\nUpdates to using the updated `LogData` structure directly. This eases out `payload` usage in favor of key-value data. \r\n\r\n```diff\r\nabstract class Span {\r\n- void log(String event, {Object payload, DateTime timestamp});\r\n+ void.log(LogData log)\r\n}\r\n```\r\n\r\n### `SpanTag` Class\r\n\r\n- Gathers standard Span tag key names into a structure. This keeps the namespace clean and also matches the API consumption from other languages.\r\n- Adds `SpanTag.error` which was absent prior.\r\n\r\n# Test Suggestion\r\n\r\n- [ ] CI pass\r\n- [ ] Example uses tracing correctly\r\n\r\nfyi: \r\n- @dustinlessard-wf \r\n- @greglittlefield-wf \r\n- @macleodbroad-wf \r\n- @sebastianmalysa-wf "},"comment":{"url":"https://api.github.com/repos/Workiva/opentracing_dart/issues/comments/403120921","html_url":"https://github.com/Workiva/opentracing_dart/pull/20#issuecomment-403120921","issue_url":"https://api.github.com/repos/Workiva/opentracing_dart/issues/20","id":403120921,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMzEyMDkyMQ==","user":{"login":"toddbeckman-wf","id":16763404,"node_id":"MDQ6VXNlcjE2NzYzNDA0","avatar_url":"https://avatars3.githubusercontent.com/u/16763404?v=4","gravatar_id":"","url":"https://api.github.com/users/toddbeckman-wf","html_url":"https://github.com/toddbeckman-wf","followers_url":"https://api.github.com/users/toddbeckman-wf/followers","following_url":"https://api.github.com/users/toddbeckman-wf/following{/other_user}","gists_url":"https://api.github.com/users/toddbeckman-wf/gists{/gist_id}","starred_url":"https://api.github.com/users/toddbeckman-wf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toddbeckman-wf/subscriptions","organizations_url":"https://api.github.com/users/toddbeckman-wf/orgs","repos_url":"https://api.github.com/users/toddbeckman-wf/repos","events_url":"https://api.github.com/users/toddbeckman-wf/events{/privacy}","received_events_url":"https://api.github.com/users/toddbeckman-wf/received_events","type":"User","site_admin":false},"created_at":"2018-07-06T19:04:01Z","updated_at":"2018-07-06T19:04:01Z","author_association":"NONE","body":"Chatted with Macleod Broad -- we probably don't need to go this direction."}}
{"actor":{"display_login":"toddbeckman-wf"}}