{"action":"created","comment":{"url":"https://api.github.com/repos/lookfwd/opentracing-cpp/pulls/comments/57516619","id":57516619,"diff_hunk":"@@ -0,0 +1,205 @@\n+#ifndef OPENTRACING_SPAN_H\n+#define OPENTRACING_SPAN_H\n+\n+#include <chrono>\n+#include <string>\n+#include <vector>\n+#include <memory>\n+#include <map>\n+\n+#include \"tracer.h\"\n+\n+namespace opentracing\n+{\n+\n+class LogData;\n+class FinishOptions;\n+class Payload;\n+\n+class AbstractTracer;\n+class AbstractSpan;\n+\n+typedef std::shared_ptr<AbstractSpan> Span;\n+typedef std::shared_ptr<AbstractTracer> Tracer;\n+\n+// Span represents an active, un-finished span in the OpenTracing system.\n+//\n+// Spans are created by the Tracer interface.\n+class AbstractSpan\n+{\n+\n+public:\n+    virtual ~AbstractSpan();\n+    \n+    // Sets or changes the operation name.\n+    virtual AbstractSpan & setOperationName(const std::string & operationName) = 0;\n+    \n+\t// Adds a tag to the span.\n+\t//\n+\t// Tag values can be of arbitrary types, however the treatment of complex\n+\t// types is dependent on the underlying tracing system implementation.\n+\t// It is expected that most tracing systems will handle primitive types\n+\t// like strings and numbers. If a tracing system cannot understand how\n+\t// to handle a particular value type, it may ignore the tag, but shall\n+\t// not panic.\n+\t//\n+\t// If there is a pre-existing tag set for `key`, it is overwritten.\n+    virtual AbstractSpan & setTag(const std::string & key, const std::string & value) = 0;\n+\t\n+\t// Sets the end timestamp and calls the `Recorder`s RecordSpan()\n+\t// internally.\n+\t//\n+\t// Finish() should be the last call made to any span instance, and to do\n+\t// otherwise leads to undefined behavior.\n+\tvirtual void finish() = 0;\n+\t\n+\t// FinishWithOptions is like Finish() but with explicit control over\n+\t// timestamps and log data.\n+    virtual void finishWithOptions(const FinishOptions & opts) = 0;\n+\n+\t// LogEvent() is equivalent to\n+\t//\n+\t//   Log(LogData{Event: event})\n+\t//\n+    virtual void logEvent(const std::string & event) = 0;\n+\n+\t// LogEventWithPayload() is equivalent to\n+\t//\n+\t//   Log(LogData{Event: event, Payload: payload0})\n+\t//\n+    virtual void logEventWithPayload(const std::string & event, const Payload & payload) = 0;\n+\n+\t// Log() records `data` to this Span.\n+\t//\n+\t// See LogData for semantic details.\n+    virtual void log(const LogData & data) = 0;\n+\n+\t// SetBaggageItem sets a key:value pair on this Span that also\n+\t// propagates to future Span children.\n+\t//\n+\t// SetBaggageItem() enables powerful functionality given a full-stack\n+\t// opentracing integration (e.g., arbitrary application data from a mobile\n+\t// app can make it, transparently, all the way into the depths of a storage\n+\t// system), and with it some powerful costs: use this feature with care.\n+\t//\n+\t// IMPORTANT NOTE #1: SetBaggageItem() will only propagate trace\n+\t// baggage items to *future* children of the Span.\n+\t//\n+\t// IMPORTANT NOTE #2: Use this thoughtfully and with care. Every key and\n+\t// value is copied into every local *and remote* child of this Span, and\n+\t// that can add up to a lot of network and cpu overhead.\n+\t//\n+\t// IMPORTANT NOTE #3: Baggage item keys have a restricted format:\n+\t// implementations may wish to use them as HTTP header keys (or key\n+\t// suffixes), and of course HTTP headers are case insensitive.\n+\t//\n+\t// As such, `restrictedKey` MUST match the regular expression\n+\t// `(?i:[a-z0-9][-a-z0-9]*)` and is case-insensitive. That is, it must\n+\t// start with a letter or number, and the remaining characters must be\n+\t// letters, numbers, or hyphens. See CanonicalizeBaggageKey(). If\n+\t// `restrictedKey` does not meet these criteria, SetBaggageItem()\n+\t// results in undefined behavior.\n+\t//\n+\t// Returns a reference to this Span for chaining, etc.\n+\tvirtual AbstractSpan & setBaggageItem(const std::string & restrictedKey, const std::string & value) = 0;","path":"include/span.h","position":104,"original_position":104,"commit_id":"0cdacfe669828f634ef972e3103dd7098fdc2860","original_commit_id":"0cdacfe669828f634ef972e3103dd7098fdc2860","user":{"login":"lookfwd","id":789359,"avatar_url":"https://avatars.githubusercontent.com/u/789359?v=3","gravatar_id":"","url":"https://api.github.com/users/lookfwd","html_url":"https://github.com/lookfwd","followers_url":"https://api.github.com/users/lookfwd/followers","following_url":"https://api.github.com/users/lookfwd/following{/other_user}","gists_url":"https://api.github.com/users/lookfwd/gists{/gist_id}","starred_url":"https://api.github.com/users/lookfwd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lookfwd/subscriptions","organizations_url":"https://api.github.com/users/lookfwd/orgs","repos_url":"https://api.github.com/users/lookfwd/repos","events_url":"https://api.github.com/users/lookfwd/events{/privacy}","received_events_url":"https://api.github.com/users/lookfwd/received_events","type":"User","site_admin":false},"body":"A bit tricky...","created_at":"2016-03-26T17:31:45Z","updated_at":"2016-03-26T17:31:45Z","html_url":"https://github.com/lookfwd/opentracing-cpp/pull/1#discussion_r57516619","pull_request_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/lookfwd/opentracing-cpp/pulls/comments/57516619"},"html":{"href":"https://github.com/lookfwd/opentracing-cpp/pull/1#discussion_r57516619"},"pull_request":{"href":"https://api.github.com/repos/lookfwd/opentracing-cpp/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/lookfwd/opentracing-cpp/pulls/1","id":63971767,"html_url":"https://github.com/lookfwd/opentracing-cpp/pull/1","diff_url":"https://github.com/lookfwd/opentracing-cpp/pull/1.diff","patch_url":"https://github.com/lookfwd/opentracing-cpp/pull/1.patch","issue_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/issues/1","number":1,"state":"open","locked":false,"title":"Adding a draft C++ implementation","user":{"login":"lookfwd","id":789359,"avatar_url":"https://avatars.githubusercontent.com/u/789359?v=3","gravatar_id":"","url":"https://api.github.com/users/lookfwd","html_url":"https://github.com/lookfwd","followers_url":"https://api.github.com/users/lookfwd/followers","following_url":"https://api.github.com/users/lookfwd/following{/other_user}","gists_url":"https://api.github.com/users/lookfwd/gists{/gist_id}","starred_url":"https://api.github.com/users/lookfwd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lookfwd/subscriptions","organizations_url":"https://api.github.com/users/lookfwd/orgs","repos_url":"https://api.github.com/users/lookfwd/repos","events_url":"https://api.github.com/users/lookfwd/events{/privacy}","received_events_url":"https://api.github.com/users/lookfwd/received_events","type":"User","site_admin":false},"body":"I'm sure there are tons of things to be improved. Please comment! Thanks!","created_at":"2016-03-23T23:58:43Z","updated_at":"2016-03-26T17:31:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"62fe556e6a9912107995940683b685dab2f1ace1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/pulls/1/commits","review_comments_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/pulls/1/comments","review_comment_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/issues/1/comments","statuses_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/statuses/0cdacfe669828f634ef972e3103dd7098fdc2860","head":{"label":"lookfwd:feature","ref":"feature","sha":"0cdacfe669828f634ef972e3103dd7098fdc2860","user":{"login":"lookfwd","id":789359,"avatar_url":"https://avatars.githubusercontent.com/u/789359?v=3","gravatar_id":"","url":"https://api.github.com/users/lookfwd","html_url":"https://github.com/lookfwd","followers_url":"https://api.github.com/users/lookfwd/followers","following_url":"https://api.github.com/users/lookfwd/following{/other_user}","gists_url":"https://api.github.com/users/lookfwd/gists{/gist_id}","starred_url":"https://api.github.com/users/lookfwd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lookfwd/subscriptions","organizations_url":"https://api.github.com/users/lookfwd/orgs","repos_url":"https://api.github.com/users/lookfwd/repos","events_url":"https://api.github.com/users/lookfwd/events{/privacy}","received_events_url":"https://api.github.com/users/lookfwd/received_events","type":"User","site_admin":false},"repo":{"id":53548290,"name":"opentracing-cpp","full_name":"lookfwd/opentracing-cpp","owner":{"login":"lookfwd","id":789359,"avatar_url":"https://avatars.githubusercontent.com/u/789359?v=3","gravatar_id":"","url":"https://api.github.com/users/lookfwd","html_url":"https://github.com/lookfwd","followers_url":"https://api.github.com/users/lookfwd/followers","following_url":"https://api.github.com/users/lookfwd/following{/other_user}","gists_url":"https://api.github.com/users/lookfwd/gists{/gist_id}","starred_url":"https://api.github.com/users/lookfwd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lookfwd/subscriptions","organizations_url":"https://api.github.com/users/lookfwd/orgs","repos_url":"https://api.github.com/users/lookfwd/repos","events_url":"https://api.github.com/users/lookfwd/events{/privacy}","received_events_url":"https://api.github.com/users/lookfwd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lookfwd/opentracing-cpp","description":"C++ implementation of the OpenTracing API http://opentracing.io","fork":false,"url":"https://api.github.com/repos/lookfwd/opentracing-cpp","forks_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/forks","keys_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/teams","hooks_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/hooks","issue_events_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/issues/events{/number}","events_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/events","assignees_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/assignees{/user}","branches_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/branches{/branch}","tags_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/tags","blobs_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/git/refs{/sha}","trees_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/statuses/{sha}","languages_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/languages","stargazers_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/stargazers","contributors_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/contributors","subscribers_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/subscribers","subscription_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/subscription","commits_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/commits{/sha}","git_commits_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/git/commits{/sha}","comments_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/comments{/number}","issue_comment_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/issues/comments{/number}","contents_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/contents/{+path}","compare_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/merges","archive_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/downloads","issues_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/issues{/number}","pulls_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/pulls{/number}","milestones_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/milestones{/number}","notifications_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/labels{/name}","releases_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/releases{/id}","deployments_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/deployments","created_at":"2016-03-10T02:27:56Z","updated_at":"2016-03-23T23:57:14Z","pushed_at":"2016-03-23T23:58:43Z","git_url":"git://github.com/lookfwd/opentracing-cpp.git","ssh_url":"git@github.com:lookfwd/opentracing-cpp.git","clone_url":"https://github.com/lookfwd/opentracing-cpp.git","svn_url":"https://github.com/lookfwd/opentracing-cpp","homepage":null,"size":12,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"lookfwd:master","ref":"master","sha":"b15f2b28f5a9db0412119a89faadbb8e27ed46ed","user":{"login":"lookfwd","id":789359,"avatar_url":"https://avatars.githubusercontent.com/u/789359?v=3","gravatar_id":"","url":"https://api.github.com/users/lookfwd","html_url":"https://github.com/lookfwd","followers_url":"https://api.github.com/users/lookfwd/followers","following_url":"https://api.github.com/users/lookfwd/following{/other_user}","gists_url":"https://api.github.com/users/lookfwd/gists{/gist_id}","starred_url":"https://api.github.com/users/lookfwd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lookfwd/subscriptions","organizations_url":"https://api.github.com/users/lookfwd/orgs","repos_url":"https://api.github.com/users/lookfwd/repos","events_url":"https://api.github.com/users/lookfwd/events{/privacy}","received_events_url":"https://api.github.com/users/lookfwd/received_events","type":"User","site_admin":false},"repo":{"id":53548290,"name":"opentracing-cpp","full_name":"lookfwd/opentracing-cpp","owner":{"login":"lookfwd","id":789359,"avatar_url":"https://avatars.githubusercontent.com/u/789359?v=3","gravatar_id":"","url":"https://api.github.com/users/lookfwd","html_url":"https://github.com/lookfwd","followers_url":"https://api.github.com/users/lookfwd/followers","following_url":"https://api.github.com/users/lookfwd/following{/other_user}","gists_url":"https://api.github.com/users/lookfwd/gists{/gist_id}","starred_url":"https://api.github.com/users/lookfwd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lookfwd/subscriptions","organizations_url":"https://api.github.com/users/lookfwd/orgs","repos_url":"https://api.github.com/users/lookfwd/repos","events_url":"https://api.github.com/users/lookfwd/events{/privacy}","received_events_url":"https://api.github.com/users/lookfwd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lookfwd/opentracing-cpp","description":"C++ implementation of the OpenTracing API http://opentracing.io","fork":false,"url":"https://api.github.com/repos/lookfwd/opentracing-cpp","forks_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/forks","keys_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/teams","hooks_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/hooks","issue_events_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/issues/events{/number}","events_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/events","assignees_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/assignees{/user}","branches_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/branches{/branch}","tags_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/tags","blobs_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/git/refs{/sha}","trees_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/statuses/{sha}","languages_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/languages","stargazers_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/stargazers","contributors_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/contributors","subscribers_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/subscribers","subscription_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/subscription","commits_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/commits{/sha}","git_commits_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/git/commits{/sha}","comments_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/comments{/number}","issue_comment_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/issues/comments{/number}","contents_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/contents/{+path}","compare_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/merges","archive_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/downloads","issues_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/issues{/number}","pulls_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/pulls{/number}","milestones_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/milestones{/number}","notifications_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/labels{/name}","releases_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/releases{/id}","deployments_url":"https://api.github.com/repos/lookfwd/opentracing-cpp/deployments","created_at":"2016-03-10T02:27:56Z","updated_at":"2016-03-23T23:57:14Z","pushed_at":"2016-03-23T23:58:43Z","git_url":"git://github.com/lookfwd/opentracing-cpp.git","ssh_url":"git@github.com:lookfwd/opentracing-cpp.git","clone_url":"https://github.com/lookfwd/opentracing-cpp.git","svn_url":"https://github.com/lookfwd/opentracing-cpp","homepage":null,"size":12,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lookfwd/opentracing-cpp/pulls/1"},"html":{"href":"https://github.com/lookfwd/opentracing-cpp/pull/1"},"issue":{"href":"https://api.github.com/repos/lookfwd/opentracing-cpp/issues/1"},"comments":{"href":"https://api.github.com/repos/lookfwd/opentracing-cpp/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/lookfwd/opentracing-cpp/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/lookfwd/opentracing-cpp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lookfwd/opentracing-cpp/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/lookfwd/opentracing-cpp/statuses/0cdacfe669828f634ef972e3103dd7098fdc2860"}}}}