diff options
author | iilyak <iilyak@users.noreply.github.com> | 2020-03-02 02:42:37 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-02 02:42:37 -0800 |
commit | b3bd36bcc4408165c00d2dc2e15da834ac619405 (patch) | |
tree | 4806672f57595d8162badaa9e40c7c5b6104cb5e | |
parent | 9e885a20c395406d0767a7b98a874c586b405343 (diff) | |
parent | 782f4fb92f257aa9ae621dd3fb8ea0b228ce1931 (diff) | |
download | couchdb-prototype/fdb-layer-before-rebase-2020-03-02.tar.gz |
Merge pull request #2597 from cloudant/add-couch-trace-headerprototype/fdb-layer-before-rebase-2020-03-02
Add support for X-Couch-Trace header
-rw-r--r-- | src/chttpd/src/chttpd.erl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/chttpd/src/chttpd.erl b/src/chttpd/src/chttpd.erl index 9888b4678..2923a1671 100644 --- a/src/chttpd/src/chttpd.erl +++ b/src/chttpd/src/chttpd.erl @@ -1251,6 +1251,9 @@ start_span(Req) -> [_ | _] -> filename:join(PathParts) end, {IsExternalSpan, RootOptions} = root_span_options(MochiReq), + + CouchTrace = header_value(Req, "X-Couch-Trace") /= undefined, + Tags = maps:merge(#{ peer => Peer, 'http.method' => Method, @@ -1259,7 +1262,7 @@ start_span(Req) -> path_parts => Path, 'span.kind' => <<"server">>, component => <<"couchdb.chttpd">>, - external => IsExternalSpan + external => IsExternalSpan orelse CouchTrace }, ExtraTags), ctrace:start_span(OperationName, [ |