You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/01/28 03:49:15 UTC
[GitHub] [couchdb] jaydoane commented on a change in pull request #2494: Add
http reporter
jaydoane commented on a change in pull request #2494: Add http reporter
URL: https://github.com/apache/couchdb/pull/2494#discussion_r371497219
##########
File path: src/ctrace/src/ctrace_config.erl
##########
@@ -98,17 +98,37 @@ maybe_start_main_tracer(TracerId) ->
start_main_tracer(TracerId) ->
- Sampler = passage_sampler_all:new(),
- Options = [
- {thrift_format,
- list_to_atom(config:get("tracing", "thrift_format", "compact"))},
- {agent_host, config:get("tracing", "agent_host", "127.0.0.1")},
- {agent_port, config:get_integer("tracing", "agent_port", 6831)},
- {default_service_name,
- list_to_atom(config:get("tracing", "app_name", "couchdb"))}
- ],
- ok = jaeger_passage:start_tracer(TracerId, Sampler, Options).
+ MaxQueueLen = config:get_integer("tracing", "max_queue_len", 1024),
+ Sampler = jaeger_passage_sampler_queue_limit:new(
+ passage_sampler_all:new(), TracerId, MaxQueueLen),
+ ServiceName = list_to_atom(config:get("tracing", "app_name", "couchdb")),
+
+ case config:get("tracing", "protocol", "udp") of
Review comment:
I'd prefer a DRYer approach here, where the tracer is only started in one place:
```erlang
Options = [
{default_service_name, ServiceName}
] ++ case config:get("tracing", "protocol", "udp") of
"udp" ->
[
{protocol, udp},
{thrift_format, list_to_atom(
config:get("tracing", "thrift_format", "compact"))},
{agent_host,
config:get("tracing", "agent_host", "127.0.0.1")},
{agent_port,
config:get_integer("tracing", "agent_port", 6831)}
];
"http" ++ _ ->
[
{protocol, http},
{endpoint,
config:get("tracing", "endpoint", "http://127.0.0.1:14268")},
{http_client, fun http_client/5}
]
end,
ok = jaeger_passage:start_tracer(TracerId, Sampler, Options).
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services