runtime: add new command to collect metrics from Kata containers

Add a new command to collect metrics and return metrics to Prometheus.

Signed-off-by: bin liu <bin@hyper.sh>
This commit is contained in:
bin liu
2020-06-10 17:40:47 +08:00
parent 186fed2a11
commit 1b75daa00f
280 changed files with 68037 additions and 96 deletions

View File

@@ -1,3 +1,8 @@
// Copyright (c) 2020 Ant Financial
//
// SPDX-License-Identifier: Apache-2.0
//
package virtcontainers
import (
@@ -57,7 +62,7 @@ var (
agentRpcDurationsHistogram = prometheus.NewHistogramVec(prometheus.HistogramOpts{
Namespace: namespaceKatashim,
Name: "agent_rpc_durations_histogram_million_seconds",
Name: "agent_rpc_durations_histogram_milliseconds",
Help: "RPC latency distributions.",
Buckets: prometheus.ExponentialBuckets(1, 2, 10),
},
@@ -65,7 +70,7 @@ var (
)
)
func RegMetrics() {
func RegisterMetrics() {
prometheus.MustRegister(hypervisorThreads)
prometheus.MustRegister(hypervisorProcStatus)
prometheus.MustRegister(hypervisorProcStat)