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/27 12:08:31 UTC
[GitHub] [couchdb] iilyak opened a new pull request #2494: Add http reporter
iilyak opened a new pull request #2494: Add http reporter
URL: https://github.com/apache/couchdb/pull/2494
## Overview
This PR adds support for http reporter for open tracing library. The http reporter is useful in following two cases:
- when you deployment doesn't include jaeger agents and you want to communicate directly to jaeger server
- when spans are greater than max udp packet size (65Kb).
## Testing recommendations
1. update rel/overlay/etc/default.ini as follows
```
diff --git a/rel/overlay/etc/default.ini b/rel/overlay/etc/default.ini
index 592445c28..69091eab3 100644
--- a/rel/overlay/etc/default.ini
+++ b/rel/overlay/etc/default.ini
@@ -572,15 +572,15 @@ min_priority = 2.0
; - jaeger.thrift over udp
; - jaeger.thrift over http
; ## Common settings
-; enabled = false ; true | false
-; app_name = couchdb ; value to use for the `location.application` tag
-; protocol = udp ; udp | http - which reporter to use
+enabled = true ; true | false
+app_name = couchdb ; value to use for the `location.application` tag
+protocol = http ; udp | http - which reporter to use
; ## jaeger.thrift over udp reporter
; thrift_format = compact ; compact | binary
; agent_host = 127.0.0.1
; agent_port = 6831
; ## jaeger.thrift over udp reporter
-; endpoint = http://127.0.0.1:14268
+endpoint = http://127.0.0.1:14268
[tracing.filters]
;
@@ -603,4 +603,4 @@ min_priority = 2.0
; corresponding operation name key configured. Thus, users can easily
; log every generated trace by including the following:
;
-; all = (#{}) -> true
+all = (#{}) -> true
```
2. start jaeger in docker container
```
docker run -d -p 6831:6831/udp -p 16686:16686 jaegertracing/all-in-one:1.14
```
3. Start couchdb dev/run --admin=adm:pass
4. Create database curl -X PUT -u adm:pass http://127.0.0.1:15984/test
5. Query database curl -X GET -u adm:pass http://127.0.0.1:15984/test -H 'X-B3-TraceId: 12345678901234567890123453782027'
6. Open http://localhost:16686/ in the browser and search for spans (you should find some traces)
## Related Issues or Pull Requests
This PR depends on
- https://github.com/apache/couchdb-jaeger-passage/pull/1
## Checklist
- [x] Code is written and works correctly
- [ ] Changes are covered by tests
- [ ] Any new configurable parameters are documented in `rel/overlay/etc/default.ini`
- [ ] A PR for documentation changes has been made in https://github.com/apache/couchdb-documentation
----------------------------------------------------------------
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
[GitHub] [couchdb] iilyak merged pull request #2494: Add http reporter
Posted by GitBox <gi...@apache.org>.
iilyak merged pull request #2494: Add http reporter
URL: https://github.com/apache/couchdb/pull/2494
----------------------------------------------------------------
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
[GitHub] [couchdb] wohali commented on a change in pull request #2494: Add
http reporter
Posted by GitBox <gi...@apache.org>.
wohali commented on a change in pull request #2494: Add http reporter
URL: https://github.com/apache/couchdb/pull/2494#discussion_r371465064
##########
File path: rebar.config.script
##########
@@ -121,13 +121,13 @@ DepDescs = [
{folsom, "folsom", {tag, "CouchDB-0.8.3"}},
{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"},
Review comment:
Please merge that first, don't put shas into `master`.
----------------------------------------------------------------
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
[GitHub] [couchdb] jaydoane commented on a change in pull request #2494: Add
http reporter
Posted by GitBox <gi...@apache.org>.
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
[GitHub] [couchdb] jaydoane commented on a change in pull request #2494: Add
http reporter
Posted by GitBox <gi...@apache.org>.
jaydoane commented on a change in pull request #2494: Add http reporter
URL: https://github.com/apache/couchdb/pull/2494#discussion_r371486556
##########
File path: src/ctrace/README.md
##########
@@ -120,9 +120,23 @@ Configuration
Traces are configured using standard CouchDB ini file based configuration.
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
Review comment:
s/reporter/reporters/
----------------------------------------------------------------
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
[GitHub] [couchdb] iilyak commented on a change in pull request #2494: Add
http reporter
Posted by GitBox <gi...@apache.org>.
iilyak commented on a change in pull request #2494: Add http reporter
URL: https://github.com/apache/couchdb/pull/2494#discussion_r371758653
##########
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:
DRYed in https://github.com/apache/couchdb/pull/2494/commits/a5445d7d949abe0f5c0df2584b0ef5cbc6964ae6
----------------------------------------------------------------
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
[GitHub] [couchdb] chewbranca commented on a change in pull request #2494:
Add http reporter
Posted by GitBox <gi...@apache.org>.
chewbranca commented on a change in pull request #2494: Add http reporter
URL: https://github.com/apache/couchdb/pull/2494#discussion_r371488948
##########
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
+ "udp" ->
+ 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)},
+ {protocol, udp},
+ {default_service_name, ServiceName}
+ ],
+ jaeger_passage:start_tracer(TracerId, Sampler, Options);
Review comment:
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?
----------------------------------------------------------------
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
[GitHub] [couchdb] iilyak commented on a change in pull request #2494: Add
http reporter
Posted by GitBox <gi...@apache.org>.
iilyak commented on a change in pull request #2494: Add http reporter
URL: https://github.com/apache/couchdb/pull/2494#discussion_r371205200
##########
File path: rebar.config.script
##########
@@ -121,13 +121,13 @@ DepDescs = [
{folsom, "folsom", {tag, "CouchDB-0.8.3"}},
{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"},
Review comment:
This sha would be updated to `{tag, "CouchDB-0.1.14-1"}` when apache/couchdb-jaeger-passage#1 is merged and correspondent tag created.
----------------------------------------------------------------
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
[GitHub] [couchdb] iilyak commented on a change in pull request #2494: Add
http reporter
Posted by GitBox <gi...@apache.org>.
iilyak commented on a change in pull request #2494: Add http reporter
URL: https://github.com/apache/couchdb/pull/2494#discussion_r371758492
##########
File path: src/ctrace/README.md
##########
@@ -120,9 +120,23 @@ Configuration
Traces are configured using standard CouchDB ini file based configuration.
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
Review comment:
fixed by https://github.com/apache/couchdb/pull/2494/commits/f825540bd2f64927572ac5c50245d77ee52bda0e
----------------------------------------------------------------
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
[GitHub] [couchdb] iilyak commented on a change in pull request #2494: Add
http reporter
Posted by GitBox <gi...@apache.org>.
iilyak commented on a change in pull request #2494: Add http reporter
URL: https://github.com/apache/couchdb/pull/2494#discussion_r371758837
##########
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
+ "udp" ->
+ 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)},
+ {protocol, udp},
+ {default_service_name, ServiceName}
+ ],
+ jaeger_passage:start_tracer(TracerId, Sampler, Options);
Review comment:
Fixed in https://github.com/apache/couchdb/pull/2494/commits/a5445d7d949abe0f5c0df2584b0ef5cbc6964ae6
----------------------------------------------------------------
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