From 7eab1fc4118ad31365d06cde6020f5a80a88767e Mon Sep 17 00:00:00 2001 From: Ben Reedy Date: Thu, 22 Oct 2020 08:50:19 +1000 Subject: [PATCH] Set mssql transactions_active to Gauge. Change also renames metric to avoid confusion. Signed-off-by: Ben Reedy --- collector/mssql.go | 10 +++++----- docs/collector.mssql.md | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/collector/mssql.go b/collector/mssql.go index c0a64797..477dc26b 100644 --- a/collector/mssql.go +++ b/collector/mssql.go @@ -387,7 +387,7 @@ type MSSQLCollector struct { TransactionsLongestTransactionRunningSeconds *prometheus.Desc TransactionsNonSnapshotVersionActiveTotal *prometheus.Desc TransactionsSnapshotActiveTotal *prometheus.Desc - TransactionsActiveTotal *prometheus.Desc + TransactionsActive *prometheus.Desc TransactionsUpdateConflictsTotal *prometheus.Desc TransactionsUpdateSnapshotActiveTotal *prometheus.Desc TransactionsVersionCleanupRateBytes *prometheus.Desc @@ -1749,8 +1749,8 @@ func NewMSSQLCollector() (Collector, error) { []string{"instance"}, nil, ), - TransactionsActiveTotal: prometheus.NewDesc( - prometheus.BuildFQName(Namespace, subsystem, "transactions_active_total"), + TransactionsActive: prometheus.NewDesc( + prometheus.BuildFQName(Namespace, subsystem, "transactions_active"), "(Transactions.Transactions)", []string{"instance"}, nil, @@ -3832,8 +3832,8 @@ func (c *MSSQLCollector) collectTransactions(ctx *ScrapeContext, ch chan<- prome ) ch <- prometheus.MustNewConstMetric( - c.TransactionsActiveTotal, - prometheus.CounterValue, + c.TransactionsActive, + prometheus.GaugeValue, v.Transactions, sqlInstance, ) diff --git a/docs/collector.mssql.md b/docs/collector.mssql.md index bd44f0ac..8d441fc4 100644 --- a/docs/collector.mssql.md +++ b/docs/collector.mssql.md @@ -235,7 +235,7 @@ Name | Description | Type | Labels `windows_mssql_transactions_longest_transaction_running_seconds` | The length of time (in seconds) since the start of the transaction that has been active longer than any other current transaction | gauge | `instance` `windows_mssql_transactions_nonsnapshot_version_active_total` | The number of currently active transactions that are not using snapshot isolation level and have made data modifications that have generated row versions in the tempdb version store | counter | `instance` `windows_mssql_transactions_snapshot_active_total` | The number of currently active transactions using the snapshot isolation level | counter | `instance` -`windows_mssql_transactions_active_total` | The number of currently active transactions of all types | counter | `instance` +`windows_mssql_transactions_active` | The number of currently active transactions of all types | gauge | `instance` `windows_mssql_transactions_update_conflicts_total` | The percentage of those transactions using the snapshot isolation level that have encountered update conflicts within the last second | counter | `instance` `windows_mssql_transactions_update_snapshot_active_total` | The number of currently active transactions using the snapshot isolation level and have modified data | counter | `instance` `windows_mssql_transactions_version_cleanup_rate_bytes` | The rate (in kilobytes per second) at which row versions are removed from the snapshot isolation version store in tempdb | gauge | `instance`