Support short suffix in zipkin config (#1840)

This commit is contained in:
Matt Moore 2020-10-26 09:28:41 -07:00 committed by GitHub
parent a2394e8895
commit a37d20384b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -241,7 +241,7 @@ func jsonTrace(traceID string) ([]model.SpanModel, error) {
func parseNamespaceFromHostname(hostname string) (string, error) {
parts := strings.Split(hostname, ".")
if len(parts) < 3 || parts[2] != "svc" {
if len(parts) < 3 || !(parts[2] == "svc" || strings.HasPrefix(parts[2], "svc:")) {
return "", fmt.Errorf("could not extract namespace/name from %s", hostname)
}
return parts[1], nil