Fix Linkerd promql queries

- include all inbound traffic stats
This commit is contained in:
stefanprodan
2019-05-14 12:14:47 +03:00
parent b2500d0ccb
commit 674c79da94
2 changed files with 9 additions and 6 deletions
+7 -4
View File
@@ -10,8 +10,9 @@ var linkerdQueries = map[string]string{
rate(
response_total{
namespace="{{ .Namespace }}",
dst_deployment=~"{{ .Name }}",
classification="failure"
deployment=~"{{ .Name }}",
classification="failure",
direction="inbound"
}[{{ .Interval }}]
)
)
@@ -20,7 +21,8 @@ var linkerdQueries = map[string]string{
rate(
response_total{
namespace="{{ .Namespace }}",
dst_deployment=~"{{ .Name }}"
deployment=~"{{ .Name }}",
direction="inbound"
}[{{ .Interval }}]
)
)
@@ -32,7 +34,8 @@ var linkerdQueries = map[string]string{
rate(
response_latency_ms_bucket{
namespace="{{ .Namespace }}",
dst_deployment=~"{{ .Name }}"
deployment=~"{{ .Name }}",
direction="inbound"
}[{{ .Interval }}]
)
) by (le)
+2 -2
View File
@@ -8,7 +8,7 @@ import (
)
func TestLinkerdObserver_GetRequestSuccessRate(t *testing.T) {
expected := `sum(rate(response_total{namespace="default",dst_deployment=~"podinfo",classification="failure"}[1m]))/sum(rate(response_total{namespace="default",dst_deployment=~"podinfo"}[1m]))*100`
expected := `sum(rate(response_total{namespace="default",deployment=~"podinfo",classification="failure",direction="inbound"}[1m]))/sum(rate(response_total{namespace="default",deployment=~"podinfo",direction="inbound"}[1m]))*100`
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
promql := r.URL.Query()["query"][0]
@@ -41,7 +41,7 @@ func TestLinkerdObserver_GetRequestSuccessRate(t *testing.T) {
}
func TestLinkerdObserver_GetRequestDuration(t *testing.T) {
expected := `histogram_quantile(0.99,sum(rate(response_latency_ms_bucket{namespace="default",dst_deployment=~"podinfo"}[1m]))by(le))`
expected := `histogram_quantile(0.99,sum(rate(response_latency_ms_bucket{namespace="default",deployment=~"podinfo",direction="inbound"}[1m]))by(le))`
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
promql := r.URL.Query()["query"][0]