Skip to content

Commit

Permalink
Merge pull request #1958 from bennerv/add-gateway-metric-for-nohost
Browse files Browse the repository at this point in the history
Add gateway metric for nohost
  • Loading branch information
bennerv authored Feb 16, 2022
2 parents 516b444 + ac1306c commit dbbd2fc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/gateway/linkid.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ func (g *gateway) isAllowed(conn *proxyproto.Conn, host string) (string, bool, e
return "", false, fmt.Errorf("gateway record not found for linkID %s", linkID)
}

// Emit a gauge for the linkID if the host is empty
if host == "" {
g.m.EmitGauge("gateway.nohost", 1, map[string]string{
"linkid": linkID,
"action": "denied",
})
}

if _, found := g.allowList[strings.ToLower(host)]; found {
return gateway.ID, true, nil
}
Expand Down

0 comments on commit dbbd2fc

Please sign in to comment.