Other files ignored by Codecov
test/jaeger_passage_repoter_tests.erl
has changed.
74 | 74 | | {process_tags, passage:tags()}. |
|
75 | 75 | %% <ul> |
|
76 | 76 | %% <li><b>endpoint</b>: The jaeger endpoint URL for sending thrift messages. The default value is `http://127.0.0.1:14268'.</li> |
|
77 | - | %% <li><b>http_client</b>: The callback to call to send span to jaeger.</li> |
|
77 | + | %% <li><b>http_client</b>: The callback to call to send span to jaeger. The httpc client is used by default.</li> |
|
78 | 78 | %% <li><b>default_service_name</b>: The default service name. If a reporting span has `location.application' tag, the value is used as the service name instead of this. The default value is `ReporterId'.</li> |
|
79 | 79 | %% <li><b>process_tags</b>: The tags of the reporting process. The default value is `#{}'.</li> |
|
80 | 80 | %% </ul> |
112 | 112 | Endpoint = proplists:get_value(endpoint, Options, "http://127.0.0.1:14268"), |
|
113 | 113 | EndpointURL = Endpoint ++ "/api/traces", |
|
114 | 114 | ||
115 | - | HttpClient = proplists:get_value(http_client, Options), |
|
116 | - | HttpClient =/= undefined orelse error(badarg, [ReporterId, Options]), |
|
115 | + | HttpClient = proplists:get_value(http_client, Options, fun httpc_client/5), |
|
116 | + | is_function(HttpClient, 5) orelse error(badarg, [ReporterId, Options]), |
|
117 | 117 | ||
118 | 118 | DefaultServiceName = proplists:get_value(default_service_name, Options, ReporterId), |
|
119 | 119 | Tags0 = proplists:get_value(process_tags, Options, #{}), |
171 | 171 | Headers = [?CONTENT_TYPE], |
|
172 | 172 | HttpClient(URI, post, Headers, Encoded, Options), |
|
173 | 173 | {noreply, State}. |
|
174 | + | ||
175 | + | -spec httpc_client( |
|
176 | + | Url :: string(), |
|
177 | + | Method :: post, |
|
178 | + | Headers :: [{string(), string()}], |
|
179 | + | Body :: string() | binary(), |
|
180 | + | ReporterOptions :: start_options()) -> |
|
181 | + | ok. |
|
182 | + | ||
183 | + | httpc_client(Url, Method, _Headers, Body, _ReporterOptions) -> |
|
184 | + | httpc:request(Method, {Url, [], "application/x-thrift", Body}, [], []), |
|
185 | + | ok. |
Files | Coverage |
---|---|
src | 85.32% |
Project Totals (11 files) | 85.32% |
TRAVIS_OS_NAME=linux
TRAVIS_OS_NAME=linux
TRAVIS_OS_NAME=linux
TRAVIS_OS_NAME=linux