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>
This commit is contained in:
Sanket Sudake
2022-12-13 14:19:36 +05:30
committed by GitHub
parent 31f4f8c57e
commit 5fae765323
26 changed files with 252 additions and 137 deletions
+10 -3
View File
@@ -2,19 +2,20 @@ package storagesvc
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/fission/fission/pkg/utils/metrics"
)
var (
functionLabels = []string{}
totalArchives = promauto.NewGaugeVec(
totalArchives = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "fission_archives",
Help: "Number of archives stored",
},
functionLabels,
)
totalMemoryUsage = promauto.NewGaugeVec(
totalMemoryUsage = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "fission_archive_memory_bytes",
Help: "Amount of memory consumed by archives",
@@ -22,3 +23,9 @@ var (
functionLabels,
)
)
func init() {
registry := metrics.Registry
registry.MustRegister(totalArchives)
registry.MustRegister(totalMemoryUsage)
}