mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
Support legacy datadog agent (#2670)
dd-agent v5 can issue some requests with trailing slashes.
(e.g.
526559be73/ddagent.py (L303)
)
Trim trailing slashes for request on /datadog/ paths to accomodate for
that.
Co-authored-by: Pierre Rossi <pierre.rossi@schibsted.com>
Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
This commit is contained in:
parent
b022f1f113
commit
e755d0ec3f
1 changed files with 3 additions and 0 deletions
|
@ -107,6 +107,9 @@ func RequestHandler(w http.ResponseWriter, r *http.Request) bool {
|
||||||
defer requestDuration.UpdateDuration(startTime)
|
defer requestDuration.UpdateDuration(startTime)
|
||||||
|
|
||||||
path := strings.Replace(r.URL.Path, "//", "/", -1)
|
path := strings.Replace(r.URL.Path, "//", "/", -1)
|
||||||
|
if strings.HasPrefix(path, "/datadog") {
|
||||||
|
path = strings.TrimSuffix(path, "/")
|
||||||
|
}
|
||||||
if strings.HasPrefix(path, "/static") {
|
if strings.HasPrefix(path, "/static") {
|
||||||
staticServer.ServeHTTP(w, r)
|
staticServer.ServeHTTP(w, r)
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in a new issue