Packages

OpenTracing Toolkit for ERlang

Current section

Files

Jump to
otter src test_zipkin.erl~
Raw

src/test_zipkin.erl~

-module(test_zipkin).
-include("zipkin_core_types.hrl").
-include("zipkin_dependencies_types.hrl").
-export([request/2]).
request(Id, Msg) ->
Req = #'Span'{trace_id = Id, name = Msg},
thrift_protocol:new(
{ok, Client} = thrift_client_util:new("127.0.0.1", 9411, otter_thrift, []),
%% "hello" function per our service definition in thrift/example.thrift:
{ClientAgain, {ok, Response}} = thrift_client:call(Client, hello, [Req]),
thrift_client:close(ClientAgain),
Response.