Просмотр исходного кода

add support for 0xx http status code (#4234)

Feroze Mohideen 2 лет назад
Родитель
Сommit
233683c19c
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      internal/kubernetes/prometheus/metrics.go

+ 3 - 0
internal/kubernetes/prometheus/metrics.go

@@ -309,6 +309,7 @@ type promParsedSingletonQueryResult struct {
 	Bytes         interface{} `json:"bytes,omitempty"`
 	Bytes         interface{} `json:"bytes,omitempty"`
 	ErrorPct      interface{} `json:"error_pct,omitempty"`
 	ErrorPct      interface{} `json:"error_pct,omitempty"`
 	Latency       interface{} `json:"latency,omitempty"`
 	Latency       interface{} `json:"latency,omitempty"`
+	StatusCode0xx interface{} `json:"0xx,omitempty"`
 	StatusCode1xx interface{} `json:"1xx,omitempty"`
 	StatusCode1xx interface{} `json:"1xx,omitempty"`
 	StatusCode2xx interface{} `json:"2xx,omitempty"`
 	StatusCode2xx interface{} `json:"2xx,omitempty"`
 	StatusCode3xx interface{} `json:"3xx,omitempty"`
 	StatusCode3xx interface{} `json:"3xx,omitempty"`
@@ -407,6 +408,8 @@ func parseNginxStatusQuery(ctx context.Context, rawQuery []byte) ([]*promParsedS
 			}
 			}
 
 
 			switch result.Metric.StatusCode {
 			switch result.Metric.StatusCode {
+			case "0xx":
+				singletonResultsByDate[dateKey].StatusCode0xx = values[1]
 			case "1xx":
 			case "1xx":
 				singletonResultsByDate[dateKey].StatusCode1xx = values[1]
 				singletonResultsByDate[dateKey].StatusCode1xx = values[1]
 			case "2xx":
 			case "2xx":