-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
backport: Add metricts collection from MTV.
Signed-off-by: Bella Khizgiyaev <[email protected]>
- Loading branch information
Showing
10 changed files
with
363 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library") | ||
|
||
go_library( | ||
name = "forklift-controller", | ||
srcs = [ | ||
"metrics.go", | ||
"migration_metrics.go", | ||
"plan_metrics.go", | ||
], | ||
importpath = "github.com/konveyor/forklift-controller/pkg/monitoring/metrics/forklift-controller", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//pkg/apis/forklift/v1beta1", | ||
"//vendor/github.com/prometheus/client_golang/prometheus", | ||
"//vendor/github.com/prometheus/client_golang/prometheus/promauto", | ||
"//vendor/sigs.k8s.io/controller-runtime/pkg/client", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
package forklift_controller | ||
|
||
import ( | ||
"github.com/prometheus/client_golang/prometheus" | ||
"github.com/prometheus/client_golang/prometheus/promauto" | ||
) | ||
|
||
const ( | ||
Succeeded = "Succeeded" | ||
Failed = "Failed" | ||
Executing = "Executing" | ||
Running = "Running" | ||
Pending = "Pending" | ||
Canceled = "Canceled" | ||
Blocked = "Blocked" | ||
Ready = "Ready" | ||
Deleted = "Deleted" | ||
Warm = "Warm" | ||
Cold = "Cold" | ||
Local = "Local" | ||
Remote = "Remote" | ||
) | ||
|
||
var ( | ||
// 'status' - [ Succeeded, Failed, Executing, Canceled] | ||
// 'provider' - [oVirt, VSphere, Openstack, OVA, Openshift] | ||
// 'mode' - [Cold, Warm] | ||
// 'target' - [Local, Remote] | ||
migrationStatusGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{ | ||
Name: "mtv_migrations_status", | ||
Help: "VM Migrations sorted by status, provider, mode and destination", | ||
}, | ||
[]string{ | ||
"status", | ||
"provider", | ||
"mode", | ||
"target", | ||
}, | ||
) | ||
|
||
// 'status' - [ Succeeded, Failed, Executing, Running, Pending, Canceled, Blocked, Deleted] | ||
// 'provider' - [oVirt, VSphere, Openstack, OVA, Openshift] | ||
// 'mode' - [Cold, Warm] | ||
// 'target' - [Local, Remote] | ||
planStatusGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{ | ||
Name: "mtv_plans_status", | ||
Help: "VM migration Plans sorted by status, provider, mode and destination", | ||
}, | ||
[]string{ | ||
"status", | ||
"provider", | ||
"mode", | ||
"target", | ||
}, | ||
) | ||
|
||
// 'status' - [ Succeeded, Failed, Executing, Canceled] | ||
// 'provider' - [oVirt, VSphere, Openstack, OVA, Openshift] | ||
// 'mode' - [Cold, Warm] | ||
// 'target' - [Local, Remote] | ||
// 'plan' - [Id] | ||
migrationDurationGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{ | ||
Name: "mtv_migration_duration_seconds", | ||
Help: "Duration of VM migrations in seconds", | ||
}, | ||
[]string{"provider", "mode", "target", "plan"}, | ||
) | ||
|
||
// 'provider' - [oVirt, VSphere, Openstack, OVA, Openshift] | ||
// 'mode' - [Cold, Warm] | ||
// 'target' - [Local, Remote] | ||
// 'plan' - [Id] | ||
dataTransferredGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{ | ||
Name: "mtv_migration_data_transferred_bytes", | ||
Help: "Total data transferred during VM migrations in bytes", | ||
}, | ||
[]string{ | ||
"provider", | ||
"mode", | ||
"target", | ||
"plan", | ||
}, | ||
) | ||
|
||
// 'status' - [ Succeeded, Failed, Executing, Canceled] | ||
// 'provider' - [oVirt, VSphere, Openstack, OVA, Openshift] | ||
// 'mode' - [Cold, Warm] | ||
// 'target' - [Local, Remote] | ||
// 'plan' - [Id] | ||
migrationPlanCorrelationStatusGauge = promauto.NewGaugeVec(prometheus.GaugeOpts{ | ||
Name: "mtv_workload_migrations_status", | ||
Help: "VM Migrations status by provider, mode, destination and plan", | ||
}, | ||
[]string{ | ||
"status", | ||
"provider", | ||
"mode", | ||
"target", | ||
"plan", | ||
}, | ||
) | ||
|
||
// 'provider' - [oVirt, VSphere, Openstack, OVA, Openshift] | ||
// 'mode' - [Cold, Warm] | ||
// 'target' - [Local, Remote] | ||
migrationDurationHistogram = promauto.NewHistogramVec(prometheus.HistogramOpts{ | ||
Name: "mtv_migrations_duration_seconds", | ||
Help: "Histogram of VM migrations duration in seconds", | ||
Buckets: []float64{1 * 3600, 2 * 3600, 5 * 3600, 10 * 3600, 24 * 3600, 48 * 3600}, // 1, 2, 5, 10, 24, 48 hours in seconds | ||
}, | ||
[]string{ | ||
"provider", | ||
"mode", | ||
"target", | ||
}, | ||
) | ||
) |
Oops, something went wrong.