plugin/trace: Fix zipkin json_v2 (#4180)

Automatically submitted.
This commit is contained in:
Bob 2020-11-10 20:03:14 +01:00 committed by GitHub
parent dd2a1bfc82
commit b7814204a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 9 deletions

View file

@ -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
}
for c.Next() { // trace
var err error
@ -115,7 +117,7 @@ func normalizeEndpoint(epType, ep string) (string, string, error) {
if epType == "zipkin" {
if !strings.Contains(ep, "http") {
ep = "http://" + ep + "/api/v1/spans"
ep = "http://" + ep + "/api/v2/spans"
}
}