diff --git a/collector/collector.go b/collector/collector.go index 0d831af..334d27e 100644 --- a/collector/collector.go +++ b/collector/collector.go @@ -66,10 +66,10 @@ type Collector struct { logins *prometheus.Desc successfulLogins *prometheus.Desc failedLogins *prometheus.Desc - warehouseExecutedQueries *prometheus.Desc - warehouseOverloadedQueueSize *prometheus.Desc - warehouseProvisioningQueueSize *prometheus.Desc - warehouseBlockedQueries *prometheus.Desc + warehouseExecutedQueryLoad *prometheus.Desc + warehouseOverloadedQueueLoad *prometheus.Desc + warehouseProvisioningQueueLoad *prometheus.Desc + warehouseBlockedQueryLoad *prometheus.Desc autoClusteringCredits *prometheus.Desc autoClusteringBytes *prometheus.Desc autoClusteringRows *prometheus.Desc @@ -161,27 +161,27 @@ func NewCollector(logger log.Logger, c *Config) *Collector { []string{labelClientType, labelClientVersion}, nil, ), - warehouseExecutedQueries: prometheus.NewDesc( + warehouseExecutedQueryLoad: prometheus.NewDesc( prometheus.BuildFQName(namespace, "warehouse", "executed_queries"), - "Average number of queries executed.", + "Average query load for queries executed over the last 24 hours.", []string{labelName, labelID}, nil, ), - warehouseOverloadedQueueSize: prometheus.NewDesc( + warehouseOverloadedQueueLoad: prometheus.NewDesc( prometheus.BuildFQName(namespace, "warehouse", "overloaded_queue_size"), - "Average number of queries queued because the warehouse was overloaded.", + "Average load value for queries queued because the warehouse was being overloaded over the last 24 hours.", []string{labelName, labelID}, nil, ), - warehouseProvisioningQueueSize: prometheus.NewDesc( + warehouseProvisioningQueueLoad: prometheus.NewDesc( prometheus.BuildFQName(namespace, "warehouse", "provisioning_queue_size"), - "Average number of queries queued because the warehouse was being provisioned.", + "Average load value for queries queued because the warehouse was being provisioned over the last 24 hours.", []string{labelName, labelID}, nil, ), - warehouseBlockedQueries: prometheus.NewDesc( + warehouseBlockedQueryLoad: prometheus.NewDesc( prometheus.BuildFQName(namespace, "warehouse", "blocked_queries"), - "Average number of queries blocked by a transaction lock.", + "Average load value for queries blocked by a transaction lock over the last 24 hours.", []string{labelName, labelID}, nil, ), @@ -264,10 +264,10 @@ func (c *Collector) Describe(descs chan<- *prometheus.Desc) { descs <- c.logins descs <- c.successfulLogins descs <- c.failedLogins - descs <- c.warehouseExecutedQueries - descs <- c.warehouseOverloadedQueueSize - descs <- c.warehouseProvisioningQueueSize - descs <- c.warehouseBlockedQueries + descs <- c.warehouseExecutedQueryLoad + descs <- c.warehouseOverloadedQueueLoad + descs <- c.warehouseProvisioningQueueLoad + descs <- c.warehouseBlockedQueryLoad descs <- c.autoClusteringCredits descs <- c.autoClusteringBytes descs <- c.autoClusteringRows @@ -470,10 +470,10 @@ func (c *Collector) collectWarehouseLoadMetrics(db *sql.DB, metrics chan<- prome return fmt.Errorf("failed to scan row: %w", err) } - metrics <- prometheus.MustNewConstMetric(c.warehouseExecutedQueries, prometheus.GaugeValue, avgRunning, warehouseName, warehouseID) - metrics <- prometheus.MustNewConstMetric(c.warehouseOverloadedQueueSize, prometheus.GaugeValue, avgQueued, warehouseName, warehouseID) - metrics <- prometheus.MustNewConstMetric(c.warehouseProvisioningQueueSize, prometheus.GaugeValue, avgQueuedProvisioning, warehouseName, warehouseID) - metrics <- prometheus.MustNewConstMetric(c.warehouseBlockedQueries, prometheus.GaugeValue, avgBlocked, warehouseName, warehouseID) + metrics <- prometheus.MustNewConstMetric(c.warehouseExecutedQueryLoad, prometheus.GaugeValue, avgRunning, warehouseName, warehouseID) + metrics <- prometheus.MustNewConstMetric(c.warehouseOverloadedQueueLoad, prometheus.GaugeValue, avgQueued, warehouseName, warehouseID) + metrics <- prometheus.MustNewConstMetric(c.warehouseProvisioningQueueLoad, prometheus.GaugeValue, avgQueuedProvisioning, warehouseName, warehouseID) + metrics <- prometheus.MustNewConstMetric(c.warehouseBlockedQueryLoad, prometheus.GaugeValue, avgBlocked, warehouseName, warehouseID) } return rows.Err() diff --git a/mixin/.lint b/mixin/.lint index 1fcab6c..60f4a3a 100644 --- a/mixin/.lint +++ b/mixin/.lint @@ -7,3 +7,14 @@ exclusions: reason: "Based on new convention we are using variable names prometheus_datasource and loki_datasource where as linter expects 'datasource'" template-instance-rule: reason: "Based on new convention we are using variable names prometheus_datasource and loki_datasource where as linter expects 'datasource'" + panel-units-rule: + reason: "Custom units are used for better user experience in some panels" + entries: + - panel: "Login attempts" + - panel: "Autoclustering credits used" + - panel: "Top 5 service compute credits used" + - panel: "Top 5 service cloud service credits used" + - panel: "Top 5 warehouse compute credits used" + - panel: "Top 5 warehouse cloud services credits used" + - panel: "Top 5 database autoclustering credits used" + - panel: "Top 5 table autoclustering credits used" diff --git a/mixin/dashboards/snowflake-overview.libsonnet b/mixin/dashboards/snowflake-overview.libsonnet index 095fc02..5777add 100644 --- a/mixin/dashboards/snowflake-overview.libsonnet +++ b/mixin/dashboards/snowflake-overview.libsonnet @@ -18,22 +18,22 @@ local warehouseActivityPanel = { prometheus.target( 'snowflake_warehouse_executed_queries{instance=~"$instance", job=~"$job", name=~"$warehouse"}', datasource=promDatasource, - legendFormat='{{instance}} - {{name}} - Executed queries' + legendFormat='{{instance}} - {{name}} - Executed query load' ), prometheus.target( 'snowflake_warehouse_overloaded_queue_size{instance=~"$instance", job=~"$job", name=~"$warehouse"}', datasource=promDatasource, - legendFormat='{{instance}} - {{name}} - Overloaded queue size' + legendFormat='{{instance}} - {{name}} - Overloaded queue load' ), prometheus.target( 'snowflake_warehouse_provisioning_queue_size{instance=~"$instance", job=~"$job", name=~"$warehouse"}', datasource=promDatasource, - legendFormat='{{instance}} - {{name}} - Provisioning queue size' + legendFormat='{{instance}} - {{name}} - Provisioning queue load' ), prometheus.target( 'snowflake_warehouse_blocked_queries{instance=~"$instance", job=~"$job", name=~"$warehouse"}', datasource=promDatasource, - legendFormat='{{instance}} - {{name}} - Blocked queries' + legendFormat='{{instance}} - {{name}} - Blocked query load' ), ], type: 'timeseries', @@ -78,7 +78,7 @@ local warehouseActivityPanel = { }, }, mappings: [], - unit: 'queries / hr', + unit: 'percentunit', }, overrides: [], },