-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
plugin/trace: Fix zipkin json_v2 and #4160 #4180
Conversation
@@ -47,6 +47,8 @@ You can run Zipkin on a Docker host like this: | |||
docker run -d -p 9411:9411 openzipkin/zipkin | |||
``` | |||
|
|||
:warning: The zipkin provider does not support the v1 API since coredns 1.7.1 |
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.
is this useful information for the reader or can we just not mention it?
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 is a "breaking" change compared to pre-1.7.1
I don't mind removing the note, I made it in response to this comment
@@ -35,7 +35,9 @@ func traceParse(c *caddy.Controller) (*trace, error) { | |||
) | |||
|
|||
cfg := dnsserver.GetConfig(c) | |||
tr.serviceEndpoint = cfg.ListenHosts[0] + ":" + cfg.Port | |||
if cfg.ListenHosts[0] != "" { | |||
tr.serviceEndpoint = cfg.ListenHosts[0] + ":" + cfg.Port |
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.
should we not add the port here? As you say in the description this doesn't work with zipkin...
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.
Zipkin does understand the port when associated with a resolvable hostname / an IP, and there is always a port in the config.
I assume to track the the correct listener you need the right couple of bind + port
That would also work with no port but would be less precise
plugin/trace/setup_test.go
Outdated
every uint64 | ||
serviceName string | ||
clientServer bool | ||
serviceEndpoint string |
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.
serviceEndpoint is empty in all tests? In general if you want to test a little new thing, just add a small new test.
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.
Fair.
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.
Removed it.
Codecov Report
@@ Coverage Diff @@
## master #4180 +/- ##
==========================================
- Coverage 55.99% 55.94% -0.05%
==========================================
Files 225 225
Lines 9930 9943 +13
==========================================
+ Hits 5560 5563 +3
- Misses 3905 3912 +7
- Partials 465 468 +3
Continue to review full report at Codecov.
|
0d3e362
to
7601659
Compare
@nyodas can you resolve conflicts please? |
7601659
to
4d743e6
Compare
0d3e362
to
7601659
Compare
7601659
to
1940c43
Compare
Done. |
In coredns#4171 i noticed that the client_server was not being used anymore. It appears that it should still be there. While testing that change i noticed that the zipkin provider was borked and couldn't push traces anymore Tcpdump showed that the zipkin server was responding with ``` Expected a JSON_V1 encoded list, but received: JSON_V2 ``` There was also an issue (coredns#4160) with ``` recorder, err := zipkin.NewEndpoint(t.serviceName, t.serviceEndpoint) ``` As `t.serviceEndpoint` is `:53` in most cases Zipkin can't parse the ip:port tuple and send a warning with ``` [WARNING] build Zipkin endpoint found err: lookup : no such host ``` cf: [openzipkin/endpoint.go](https://github.com/openzipkin/zipkin-go/blob/master/endpoint.go#L27-L80) To actively set a correct values in serviceEnpoint you need to use the bind plugin ``` .:53 { bind 127.0.0.1 trace } ``` Signed-off-by: bob <bob.bouteillier@datadoghq.com>
1940c43
to
36957e5
Compare
Codecov Report
@@ Coverage Diff @@
## master #4180 +/- ##
==========================================
- Coverage 56.05% 56.04% -0.01%
==========================================
Files 223 223
Lines 9850 9852 +2
==========================================
+ Hits 5521 5522 +1
Misses 3867 3867
- Partials 462 463 +1
Continue to review full report at Codecov.
|
@nyodas The
|
Thanks! /lgtm |
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.
Approved by johnbelamaric
1. Why is this pull request needed and what does it do?
In #4171 i noticed that the client_server was not being used anymore.
It appears that it should still be there.
While testing that change i noticed that the zipkin provider was borked and couldn't push traces anymore
Tcpdump showed that the zipkin server was responding with
There was also an issue (#4160) with
As
t.serviceEndpoint
is:53
in most casesZipkin can't parse the ip:port tuple and send a warning with
cf: openzipkin/endpoint.go
To actively set a correct values in serviceEndpoint you need to use the bind plugin
2. Which issues (if any) are related?
#4160
#4109
#4171
3. Which documentation changes (if any) need to be made?
Indicate that the zipkin api v1 is not working as of
1.7.1
4. Does this introduce a backward incompatible change or deprecation?
Yes the api version of zipkin is now using
v2
Though that fix a bug introduced with #4109