Skip to content

Commit

Permalink
metrics: Remove port name when parsing server name
Browse files Browse the repository at this point in the history
  • Loading branch information
sgreene570 committed Aug 29, 2020
1 parent 5a5cc82 commit 0f87e9e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 35 deletions.
12 changes: 8 additions & 4 deletions pkg/router/metrics/haproxy/haproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,13 +543,17 @@ func knownServerSegment(value string) (string, string, string, bool) {
if i := strings.Index(value, ":"); i != -1 {
switch value[:i] {
case "ept":
if service, server, ok := parseNameSegment(value[i+1:]); ok {
return "", service, server, true
if service, remainder, ok := parseNameSegment(value[i+1:]); ok {
if _, server, ok := parseNameSegment(remainder); ok {
return "", service, server, true
}
}
case "pod":
if pod, remainder, ok := parseNameSegment(value[i+1:]); ok {
if service, server, ok := parseNameSegment(remainder); ok {
return pod, service, server, true
if service, remainder, ok := parseNameSegment(remainder); ok {
if _, server, ok := parseNameSegment(remainder); ok {
return pod, service, server, true
}
}
}
}
Expand Down
Loading

0 comments on commit 0f87e9e

Please sign in to comment.