mirror of
https://github.com/openfaas/faas.git
synced 2025-06-22 23:03:24 +00:00
Add HTTP status code to histogram
The histogram for gateway_functions_seconds excluded the status code that gives important information for setting up SLOs. Fixes: #1725 Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
This commit is contained in:
committed by
Alex Ellis
parent
96cfdee085
commit
cc2f38938e
@ -48,7 +48,7 @@ func Test_Describe_DescribesThePrometheusMetrics(t *testing.T) {
|
||||
}
|
||||
|
||||
d = <-ch
|
||||
expectedGatewayFunctionsHistogramDesc := `Desc{fqName: "gateway_functions_seconds", help: "Function time taken", constLabels: {}, variableLabels: [function_name]}`
|
||||
expectedGatewayFunctionsHistogramDesc := `Desc{fqName: "gateway_functions_seconds", help: "Function time taken", constLabels: {}, variableLabels: [function_name code]}`
|
||||
actualGatewayFunctionsHistogramDesc := d.String()
|
||||
if expectedGatewayFunctionsHistogramDesc != actualGatewayFunctionsHistogramDesc {
|
||||
t.Errorf("Want\n%s\ngot\n%s", expectedGatewayFunctionsHistogramDesc, actualGatewayFunctionsHistogramDesc)
|
||||
|
@ -50,7 +50,7 @@ func BuildMetricsOptions() MetricOptions {
|
||||
gatewayFunctionsHistogram := prometheus.NewHistogramVec(prometheus.HistogramOpts{
|
||||
Name: "gateway_functions_seconds",
|
||||
Help: "Function time taken",
|
||||
}, []string{"function_name"})
|
||||
}, []string{"function_name", "code"})
|
||||
|
||||
gatewayFunctionInvocation := prometheus.NewCounterVec(
|
||||
prometheus.CounterOpts{
|
||||
|
Reference in New Issue
Block a user