Skip to content

Commit

Permalink
Merge pull request #143 from tsloughter/move-propagators-api
Browse files Browse the repository at this point in the history
move propagators to the api
  • Loading branch information
tsloughter committed Nov 14, 2020
2 parents 0e448fd + f12ecf7 commit 1d5a5a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
-export([inject/1,
extract/2]).

-include_lib("opentelemetry_api/include/opentelemetry.hrl").
-include("otel_tracer.hrl").
-include("opentelemetry.hrl").

-define(B3_TRACE_ID, <<"X-B3-TraceId">>).
-define(B3_SPAN_ID, <<"X-B3-SpanId">>).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
extract/2,
decode/1]).

-include_lib("opentelemetry_api/include/opentelemetry.hrl").
-include("otel_tracer.hrl").
-include("opentelemetry.hrl").

-define(VERSION, <<"00">>).

Expand Down Expand Up @@ -66,7 +65,7 @@ encode_tracestate(#span_ctx{tracestate=Entries}) ->
StateHeaderValue = lists:join($,, [[Key, $=, Value] || {Key, Value} <- Entries]),
[{?STATE_HEADER_KEY, unicode:characters_to_binary(StateHeaderValue)}].

-spec extract(otel_propagator:http_headers(), term()) -> opentelemetry:span_ctx()| undefined.
-spec extract(otel_propagator:text_map(), term()) -> opentelemetry:span_ctx()| undefined.
extract(Headers, _) when is_list(Headers) ->
case header_take(?HEADER_KEY, Headers) of
[{_, Value} | RestHeaders] ->
Expand Down

0 comments on commit 1d5a5a0

Please sign in to comment.