Skip to content

Commit

Permalink
update resource->item
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminjb committed Jun 1, 2021
1 parent 9d87d88 commit aa3bfab
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 37 deletions.
50 changes: 25 additions & 25 deletions collector/mssql.go
Original file line number Diff line number Diff line change
Expand Up @@ -1810,84 +1810,84 @@ func NewMSSQLCollector() (Collector, error) {
WaitStatsLockWaits: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "waitstats_lock_waits"),
"(WaitStats.LockWaits)",
[]string{"mssql_instance", "resource"},
[]string{"mssql_instance", "item"},
nil,
),

WaitStatsMemoryGrantQueueWaits: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "waitstats_memory_grant_queue_waits"),
"(WaitStats.MemoryGrantQueueWaits)",
[]string{"mssql_instance", "resource"},
[]string{"mssql_instance", "item"},
nil,
),

WaitStatsThreadSafeMemoryObjectsWaits: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "waitstats_thread_safe_memory_objects_waits"),
"(WaitStats.ThreadSafeMemoryObjectsWaits)",
[]string{"mssql_instance", "resource"},
[]string{"mssql_instance", "item"},
nil,
),

WaitStatsLogWriteWaits: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "waitstats_log_write_waits"),
"(WaitStats.LogWriteWaits)",
[]string{"mssql_instance", "resource"},
[]string{"mssql_instance", "item"},
nil,
),

WaitStatsLogBufferWaits: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "waitstats_log_buffer_waits"),
"(WaitStats.LogBufferWaits)",
[]string{"mssql_instance", "resource"},
[]string{"mssql_instance", "item"},
nil,
),

WaitStatsNetworkIOWaits: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "waitstats_network_io_waits"),
"(WaitStats.NetworkIOWaits)",
[]string{"mssql_instance", "resource"},
[]string{"mssql_instance", "item"},
nil,
),

WaitStatsPageIOLatchWaits: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "waitstats_page_io_latch_waits"),
"(WaitStats.PageIOLatchWaits)",
[]string{"mssql_instance", "resource"},
[]string{"mssql_instance", "item"},
nil,
),

WaitStatsPageLatchWaits: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "waitstats_page_latch_waits"),
"(WaitStats.PageLatchWaits)",
[]string{"mssql_instance", "resource"},
[]string{"mssql_instance", "item"},
nil,
),

WaitStatsNonpageLatchWaits: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "waitstats_nonpage_latch_waits"),
"(WaitStats.NonpageLatchWaits)",
[]string{"mssql_instance", "resource"},
[]string{"mssql_instance", "item"},
nil,
),

WaitStatsWaitForTheWorkerWaits: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "waitstats_wait_for_the_worker_waits"),
"(WaitStats.WaitForTheWorkerWaits)",
[]string{"mssql_instance", "resource"},
[]string{"mssql_instance", "item"},
nil,
),

WaitStatsWorkspaceSynchronizationWaits: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "waitstats_workspace_synchronization_waits"),
"(WaitStats.WorkspaceSynchronizationWaits)",
[]string{"mssql_instance", "resource"},
[]string{"mssql_instance", "item"},
nil,
),

WaitStatsTransactionOwnershipWaits: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "waitstats_transaction_ownership_waits"),
"(WaitStats.TransactionOwnershipWaits)",
[]string{"mssql_instance", "resource"},
[]string{"mssql_instance", "item"},
nil,
),

Expand Down Expand Up @@ -3860,90 +3860,90 @@ func (c *MSSQLCollector) collectWaitStats(ctx *ScrapeContext, ch chan<- promethe
}

for _, v := range dst {
resource := v.Name
item := v.Name

ch <- prometheus.MustNewConstMetric(
c.WaitStatsLockWaits,
prometheus.GaugeValue,
v.WaitStatsLockWaits,
sqlInstance, resource,
sqlInstance, item,
)

ch <- prometheus.MustNewConstMetric(
c.WaitStatsMemoryGrantQueueWaits,
prometheus.GaugeValue,
v.WaitStatsMemoryGrantQueueWaits,
sqlInstance, resource,
sqlInstance, item,
)

ch <- prometheus.MustNewConstMetric(
c.WaitStatsThreadSafeMemoryObjectsWaits,
prometheus.GaugeValue,
v.WaitStatsThreadSafeMemoryObjectsWaits,
sqlInstance, resource,
sqlInstance, item,
)

ch <- prometheus.MustNewConstMetric(
c.WaitStatsLogWriteWaits,
prometheus.GaugeValue,
v.WaitStatsLogWriteWaits,
sqlInstance, resource,
sqlInstance, item,
)

ch <- prometheus.MustNewConstMetric(
c.WaitStatsLogBufferWaits,
prometheus.GaugeValue,
v.WaitStatsLogBufferWaits,
sqlInstance, resource,
sqlInstance, item,
)

ch <- prometheus.MustNewConstMetric(
c.WaitStatsNetworkIOWaits,
prometheus.GaugeValue,
v.WaitStatsNetworkIOWaits,
sqlInstance, resource,
sqlInstance, item,
)

ch <- prometheus.MustNewConstMetric(
c.WaitStatsPageIOLatchWaits,
prometheus.GaugeValue,
v.WaitStatsPageIOLatchWaits,
sqlInstance, resource,
sqlInstance, item,
)

ch <- prometheus.MustNewConstMetric(
c.WaitStatsPageLatchWaits,
prometheus.GaugeValue,
v.WaitStatsPageLatchWaits,
sqlInstance, resource,
sqlInstance, item,
)

ch <- prometheus.MustNewConstMetric(
c.WaitStatsNonpageLatchWaits,
prometheus.GaugeValue,
v.WaitStatsNonpageLatchWaits,
sqlInstance, resource,
sqlInstance, item,
)

ch <- prometheus.MustNewConstMetric(
c.WaitStatsWaitForTheWorkerWaits,
prometheus.GaugeValue,
v.WaitStatsWaitForTheWorkerWaits,
sqlInstance, resource,
sqlInstance, item,
)

ch <- prometheus.MustNewConstMetric(
c.WaitStatsWorkspaceSynchronizationWaits,
prometheus.GaugeValue,
v.WaitStatsWorkspaceSynchronizationWaits,
sqlInstance, resource,
sqlInstance, item,
)

ch <- prometheus.MustNewConstMetric(
c.WaitStatsTransactionOwnershipWaits,
prometheus.GaugeValue,
v.WaitStatsTransactionOwnershipWaits,
sqlInstance, resource,
sqlInstance, item,
)
}

Expand Down
24 changes: 12 additions & 12 deletions docs/collector.mssql.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,18 +244,18 @@ Name | Description | Type | Labels
`windows_mssql_transactions_version_store_units` | The number of active allocation units in the snapshot isolation version store in tempdb | counter | `mssql_instance`
`windows_mssql_transactions_version_store_creation_units` | The number of allocation units that have been created in the snapshot isolation store since the instance of the Database Engine was started | counter | `mssql_instance`
`windows_mssql_transactions_version_store_truncation_units` | The number of allocation units that have been removed from the snapshot isolation store since the instance of the Database Engine was started | counter | `mssql_instance`
`windows_mssql_waitstats_lock_waits` | Statistics for processes waiting on a lock... | counter | `mssql_instance`, `resource`
`windows_mssql_waitstats_memory_grant_queue_waits` | Statistics for processes waiting on a lock... | counter | `mssql_instance`, `resource`
`windows_mssql_waitstats_thread_safe_memory_objects_waits` | Statistics for processes waiting on a lock... | counter | `mssql_instance`, `resource`
`windows_mssql_waitstats_log_write_waits` | Statistics for processes waiting on a lock... | counter | `mssql_instance`, `resource`
`windows_mssql_waitstats_log_buffer_waits` | Statistics for processes waiting on a lock... | counter | `mssql_instance`, `resource`
`windows_mssql_waitstats_network_io_waits` | Statistics for processes waiting on a lock... | counter | `mssql_instance`, `resource`
`windows_mssql_waitstats_page_io_latch_waits` | Statistics for processes waiting on a lock... | counter | `mssql_instance`, `resource`
`windows_mssql_waitstats_page_latch_waits` | Statistics for processes waiting on a lock... | counter | `mssql_instance`, `resource`
`windows_mssql_waitstats_nonpage_latch_waits` | Statistics for processes waiting on a lock... | counter | `mssql_instance`, `resource`
`windows_mssql_waitstats_wait_for_the_worker_waits` | Statistics for processes waiting on a lock... | counter | `mssql_instance`, `resource`
`windows_mssql_waitstats_workspace_synchronization_waits` | Statistics for processes waiting on a lock... | counter | `mssql_instance`, `resource`
`windows_mssql_waitstats_transaction_ownership_waits` | Statistics for processes waiting on a lock... | counter | `mssql_instance`, `resource`
`windows_mssql_waitstats_lock_waits` | Statistics for processes waiting on a lock | counter | `mssql_instance`, `item`
`windows_mssql_waitstats_memory_grant_queue_waits` | Statistics for processes waiting for memory grant to become available | counter | `mssql_instance`, `item`
`windows_mssql_waitstats_thread_safe_memory_objects_waits` | Statistics for processes waiting on thread-safe memory allocators | counter | `mssql_instance`, `item`
`windows_mssql_waitstats_log_write_waits` | Statistics for processes waiting for log buffer to be written | counter | `mssql_instance`, `item`
`windows_mssql_waitstats_log_buffer_waits` | Statistics for processes waiting for log buffer to be available | counter | `mssql_instance`, `item`
`windows_mssql_waitstats_network_io_waits` | Statistics relevant to wait on network I/O | counter | `mssql_instance`, `item`
`windows_mssql_waitstats_page_io_latch_waits` | Statistics relevant to page I/O latches | counter | `mssql_instance`, `item`
`windows_mssql_waitstats_page_latch_waits` | Statistics relevant to page latches, not including I/O latches | counter | `mssql_instance`, `item`
`windows_mssql_waitstats_nonpage_latch_waits` | Statistics relevant to non-page latches | counter | `mssql_instance`, `item`
`windows_mssql_waitstats_wait_for_the_worker_waits` | Statistics relevant to processes waiting for worker to become available | counter | `mssql_instance`, `item`
`windows_mssql_waitstats_workspace_synchronization_waits` | Statistics relevant to processes synchronizing access to workspace | counter | `mssql_instance`, `item`
`windows_mssql_waitstats_transaction_ownership_waits` | Statistics relevant to processes synchronizing access to transaction | counter | `mssql_instance`, `item`

### Example metric
_This collector does not yet have explained examples, we would appreciate your help adding them!_
Expand Down

0 comments on commit aa3bfab

Please sign in to comment.