Plugins: Add metrics for fs + cloud provisioning info (#111030)
* add new metrics for plugin fs + cloud provisioning * fix test * update label
This commit is contained in:
@@ -202,6 +202,10 @@ var (
|
||||
|
||||
grafanaPluginTargetInfoDesc *prometheus.GaugeVec
|
||||
|
||||
grafanaPluginFileSystemInfoDesc *prometheus.GaugeVec
|
||||
|
||||
grafanaPluginProvisioningInfoDesc *prometheus.GaugeVec
|
||||
|
||||
// StatsTotalLibraryPanels is a metric of total number of library panels stored in Grafana.
|
||||
StatsTotalLibraryPanels prometheus.Gauge
|
||||
|
||||
@@ -578,6 +582,18 @@ func init() {
|
||||
Namespace: ExporterName,
|
||||
}, []string{"plugin_id", "target"})
|
||||
|
||||
grafanaPluginFileSystemInfoDesc = prometheus.NewGaugeVec(prometheus.GaugeOpts{
|
||||
Name: "plugin_filesystem_info",
|
||||
Help: "A metric with a constant '1' value labeled by pluginId and filesystem type",
|
||||
Namespace: ExporterName,
|
||||
}, []string{"plugin_id", "filesystem_type"})
|
||||
|
||||
grafanaPluginProvisioningInfoDesc = prometheus.NewGaugeVec(prometheus.GaugeOpts{
|
||||
Name: "plugin_provisioning_info",
|
||||
Help: "A metric with a constant '1' value labeled by pluginId and cloud provisioning method",
|
||||
Namespace: ExporterName,
|
||||
}, []string{"plugin_id", "provisioning_method"})
|
||||
|
||||
StatsTotalDashboardVersions = prometheus.NewGauge(prometheus.GaugeOpts{
|
||||
Name: "stat_totals_dashboard_versions",
|
||||
Help: "total amount of dashboard versions in the database",
|
||||
@@ -722,6 +738,14 @@ func SetPluginTargetInformation(pluginID, target string) {
|
||||
grafanaPluginTargetInfoDesc.WithLabelValues(pluginID, target).Set(1)
|
||||
}
|
||||
|
||||
func SetPluginFSInformation(pluginID, fsType string) {
|
||||
grafanaPluginFileSystemInfoDesc.WithLabelValues(pluginID, fsType).Set(1)
|
||||
}
|
||||
|
||||
func SetPluginProvisioningInformation(pluginID, provisioningMethod string) {
|
||||
grafanaPluginProvisioningInfoDesc.WithLabelValues(pluginID, provisioningMethod).Set(1)
|
||||
}
|
||||
|
||||
func initMetricVars(reg prometheus.Registerer) {
|
||||
reg.MustRegister(
|
||||
MInstanceStart,
|
||||
@@ -777,6 +801,8 @@ func initMetricVars(reg prometheus.Registerer) {
|
||||
StatsTotalDataSources,
|
||||
grafanaPluginBuildInfoDesc,
|
||||
grafanaPluginTargetInfoDesc,
|
||||
grafanaPluginFileSystemInfoDesc,
|
||||
grafanaPluginProvisioningInfoDesc,
|
||||
StatsTotalDashboardVersions,
|
||||
StatsTotalAnnotations,
|
||||
StatsTotalAlertRules,
|
||||
|
||||
Reference in New Issue
Block a user