Files
fission-src/pkg/router/metrics.go
T
Sanket SudakeandGitHub 5fae765323 Use client generator to generate all k8s clients and add respective client-go metrics (#2668)
* Define client generator to generate all k8s clients
* Increase QPS and burst values
* Capture client-go metrics
* Support for controller runtime metrics

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
2022-12-13 14:19:36 +05:30

49 lines
1.3 KiB
Go

package router
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/fission/fission/pkg/utils/metrics"
)
var (
// function + http labels as strings
labelsStrings = []string{"function_namespace", "function_name", "path", "method", "code"}
// Function http calls count
// function_namespace: function namespace
// function_name: function name
// code: http status code
// path: the client call the function on which http path
// method: the function's http method
functionCalls = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "fission_function_calls_total",
Help: "Count of Fission function calls",
},
labelsStrings,
)
functionCallErrors = prometheus.NewCounterVec(
prometheus.CounterOpts{
Name: "fission_function_errors_total",
Help: "Count of Fission function errors",
},
labelsStrings,
)
functionCallOverhead = prometheus.NewSummaryVec(
prometheus.SummaryOpts{
Name: "fission_function_overhead_seconds",
Help: "The function call delay caused by fission.",
Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
},
labelsStrings,
)
)
func init() {
registry := metrics.Registry
registry.MustRegister(functionCalls)
registry.MustRegister(functionCallErrors)
registry.MustRegister(functionCallOverhead)
}