-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add http reporter #2494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add http reporter #2494
Conversation
rebar.config.script
Outdated
| {hyper, "hyper", {tag, "CouchDB-2.2.0-4"}}, | ||
| {ibrowse, "ibrowse", {tag, "CouchDB-4.0.1-1"}}, | ||
| {jaeger_passage, "jaeger-passage", {tag, "CouchDB-0.1.13-1"}}, | ||
| {jaeger_passage, "jaeger-passage", "7f56a93393070fb6e3778615a2d040573b10a6f3"}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sha would be updated to {tag, "CouchDB-0.1.14-1"} when apache/couchdb-jaeger-passage#1 is merged and correspondent tag created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please merge that first, don't put shas into master.
chewbranca
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit on asserting ok, but other than that looks good to me!
src/ctrace/src/ctrace_config.erl
Outdated
| {protocol, udp}, | ||
| {default_service_name, ServiceName} | ||
| ], | ||
| jaeger_passage:start_tracer(TracerId, Sampler, Options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit, but the previous version of this function matched ok against jaeger_passage:start_tracer(...), whereas this version does not. Was that an intentional behavior change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in a5445d7
jaydoane
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/ctrace/README.md
Outdated
| There is a global toggle `[tracing] enabled = true | false` that switches | ||
| tracing on or off completely. The `[tracing]` section also includes | ||
| configuration for where to send trace data. | ||
| configuration for where to send trace data. There are two reporter which we |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/reporter/reporters/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed by f825540
src/ctrace/src/ctrace_config.erl
Outdated
| passage_sampler_all:new(), TracerId, MaxQueueLen), | ||
| ServiceName = list_to_atom(config:get("tracing", "app_name", "couchdb")), | ||
|
|
||
| case config:get("tracing", "protocol", "udp") of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer a DRYer approach here, where the tracer is only started in one place:
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).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DRYed in a5445d7
a5445d7 to
bd3c021
Compare

Overview
This PR adds support for http reporter for open tracing library. The http reporter is useful in following two cases:
Testing recommendations
Related Issues or Pull Requests
This PR depends on
Checklist
rel/overlay/etc/default.ini