-
Notifications
You must be signed in to change notification settings - Fork 706
/
mssql.go
4132 lines (3775 loc) · 136 KB
/
mssql.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//go:build windows
package mssql
import (
"errors"
"fmt"
"os"
"strings"
"sync"
"time"
"github.com/alecthomas/kingpin/v2"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus-community/windows_exporter/pkg/perflib"
"github.com/prometheus-community/windows_exporter/pkg/types"
"github.com/prometheus-community/windows_exporter/pkg/utils"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/sys/windows/registry"
)
const Name = "mssql"
type Config struct {
EnabledCollectors string `yaml:"collectors_enabled"`
}
var ConfigDefaults = Config{
EnabledCollectors: "accessmethods,availreplica,bufman,databases,dbreplica,genstats,locks,memmgr,sqlstats,sqlerrors,transactions,waitstats",
}
type mssqlInstancesType map[string]string
func getMSSQLInstances(logger log.Logger) mssqlInstancesType {
sqlInstances := make(mssqlInstancesType)
// in case querying the registry fails, return the default instance
sqlDefaultInstance := make(mssqlInstancesType)
sqlDefaultInstance["MSSQLSERVER"] = ""
regkey := `Software\Microsoft\Microsoft SQL Server\Instance Names\SQL`
k, err := registry.OpenKey(registry.LOCAL_MACHINE, regkey, registry.QUERY_VALUE)
if err != nil {
_ = level.Warn(logger).Log("msg", "Couldn't open registry to determine SQL instances", "err", err)
return sqlDefaultInstance
}
defer func() {
err = k.Close()
if err != nil {
_ = level.Warn(logger).Log("msg", "Failed to close registry key", "err", err)
}
}()
instanceNames, err := k.ReadValueNames(0)
if err != nil {
_ = level.Warn(logger).Log("msg", "Can't ReadSubKeyNames", "err", err)
return sqlDefaultInstance
}
for _, instanceName := range instanceNames {
if instanceVersion, _, err := k.GetStringValue(instanceName); err == nil {
sqlInstances[instanceName] = instanceVersion
}
}
_ = level.Debug(logger).Log("msg", fmt.Sprintf("Detected MSSQL Instances: %#v\n", sqlInstances))
return sqlInstances
}
type mssqlCollectorsMap map[string]mssqlCollectorFunc
func (c *Collector) getMSSQLCollectors() mssqlCollectorsMap {
mssqlCollectors := make(mssqlCollectorsMap)
mssqlCollectors["accessmethods"] = c.collectAccessMethods
mssqlCollectors["availreplica"] = c.collectAvailabilityReplica
mssqlCollectors["bufman"] = c.collectBufferManager
mssqlCollectors["databases"] = c.collectDatabases
mssqlCollectors["dbreplica"] = c.collectDatabaseReplica
mssqlCollectors["genstats"] = c.collectGeneralStatistics
mssqlCollectors["locks"] = c.collectLocks
mssqlCollectors["memmgr"] = c.collectMemoryManager
mssqlCollectors["sqlstats"] = c.collectSQLStats
mssqlCollectors["sqlerrors"] = c.collectSQLErrors
mssqlCollectors["transactions"] = c.collectTransactions
mssqlCollectors["waitstats"] = c.collectWaitStats
return mssqlCollectors
}
// mssqlGetPerfObjectName - Returns the name of the Windows Performance
// Counter object for the given SQL instance and Collector.
func mssqlGetPerfObjectName(sqlInstance string, collector string) string {
prefix := "SQLServer:"
if sqlInstance != "MSSQLSERVER" {
prefix = "MSSQL$" + sqlInstance + ":"
}
suffix := ""
switch collector {
case "accessmethods":
suffix = "Access Methods"
case "availreplica":
suffix = "Availability Replica"
case "bufman":
suffix = "Buffer Manager"
case "databases":
suffix = "Databases"
case "dbreplica":
suffix = "Database Replica"
case "genstats":
suffix = "General Statistics"
case "locks":
suffix = "Locks"
case "memmgr":
suffix = "Memory Manager"
case "sqlerrors":
suffix = "SQL Errors"
case "sqlstats":
suffix = "SQL Statistics"
case "transactions":
suffix = "Transactions"
case "waitstats":
suffix = "Wait Statistics"
}
return prefix + suffix
}
// A Collector is a Prometheus Collector for various WMI Win32_PerfRawData_MSSQLSERVER_* metrics
type Collector struct {
logger log.Logger
mssqlEnabledCollectors *string
mssqlPrintCollectors *bool
// meta
mssqlScrapeDurationDesc *prometheus.Desc
mssqlScrapeSuccessDesc *prometheus.Desc
// Win32_PerfRawData_{instance}_SQLServerAccessMethods
accessMethodsAUcleanupbatches *prometheus.Desc
accessMethodsAUcleanups *prometheus.Desc
accessMethodsByReferenceLobCreateCount *prometheus.Desc
accessMethodsByReferenceLobUseCount *prometheus.Desc
accessMethodsCountLobReadahead *prometheus.Desc
accessMethodsCountPullInRow *prometheus.Desc
accessMethodsCountPushOffRow *prometheus.Desc
accessMethodsDeferreddroppedAUs *prometheus.Desc
accessMethodsDeferredDroppedrowsets *prometheus.Desc
accessMethodsDroppedrowsetcleanups *prometheus.Desc
accessMethodsDroppedrowsetsskipped *prometheus.Desc
accessMethodsExtentDeallocations *prometheus.Desc
accessMethodsExtentsAllocated *prometheus.Desc
accessMethodsFailedAUcleanupbatches *prometheus.Desc
accessMethodsFailedleafpagecookie *prometheus.Desc
accessMethodsFailedtreepagecookie *prometheus.Desc
accessMethodsForwardedRecords *prometheus.Desc
accessMethodsFreeSpacePageFetches *prometheus.Desc
accessMethodsFreeSpaceScans *prometheus.Desc
accessMethodsFullScans *prometheus.Desc
accessMethodsIndexSearches *prometheus.Desc
accessMethodsInSysXactwaits *prometheus.Desc
accessMethodsLobHandleCreateCount *prometheus.Desc
accessMethodsLobHandleDestroyCount *prometheus.Desc
accessMethodsLobSSProviderCreateCount *prometheus.Desc
accessMethodsLobSSProviderDestroyCount *prometheus.Desc
accessMethodsLobSSProviderTruncationCount *prometheus.Desc
accessMethodsMixedPageAllocations *prometheus.Desc
accessMethodsPageCompressionAttempts *prometheus.Desc
accessMethodsPageDeallocations *prometheus.Desc
accessMethodsPagesAllocated *prometheus.Desc
accessMethodsPagesCompressed *prometheus.Desc
accessMethodsPageSplits *prometheus.Desc
accessMethodsProbeScans *prometheus.Desc
accessMethodsRangeScans *prometheus.Desc
accessMethodsScanPointRevalidations *prometheus.Desc
accessMethodsSkippedGhostedRecords *prometheus.Desc
accessMethodsTableLockEscalations *prometheus.Desc
accessMethodsUsedleafpagecookie *prometheus.Desc
accessMethodsUsedtreepagecookie *prometheus.Desc
accessMethodsWorkfilesCreated *prometheus.Desc
accessMethodsWorktablesCreated *prometheus.Desc
accessMethodsWorktablesFromCacheHits *prometheus.Desc
accessMethodsWorktablesFromCacheLookups *prometheus.Desc
// Win32_PerfRawData_{instance}_SQLServerAvailabilityReplica
availReplicaBytesReceivedFromReplica *prometheus.Desc
availReplicaBytesSentToReplica *prometheus.Desc
availReplicaBytesSentToTransport *prometheus.Desc
availReplicaFlowControl *prometheus.Desc
availReplicaFlowControlTimeMS *prometheus.Desc
availReplicaReceivesFromReplica *prometheus.Desc
availReplicaResentMessages *prometheus.Desc
availReplicaSendsToReplica *prometheus.Desc
availReplicaSendsToTransport *prometheus.Desc
// Win32_PerfRawData_{instance}_SQLServerBufferManager
bufManBackgroundwriterpages *prometheus.Desc
bufManBuffercachehits *prometheus.Desc
bufManBuffercachelookups *prometheus.Desc
bufManCheckpointpages *prometheus.Desc
bufManDatabasepages *prometheus.Desc
bufManExtensionallocatedpages *prometheus.Desc
bufManExtensionfreepages *prometheus.Desc
bufManExtensioninuseaspercentage *prometheus.Desc
bufManExtensionoutstandingIOcounter *prometheus.Desc
bufManExtensionpageevictions *prometheus.Desc
bufManExtensionpagereads *prometheus.Desc
bufManExtensionpageunreferencedtime *prometheus.Desc
bufManExtensionpagewrites *prometheus.Desc
bufManFreeliststalls *prometheus.Desc
bufManIntegralControllerSlope *prometheus.Desc
bufManLazywrites *prometheus.Desc
bufManPagelifeexpectancy *prometheus.Desc
bufManPagelookups *prometheus.Desc
bufManPagereads *prometheus.Desc
bufManPagewrites *prometheus.Desc
bufManReadaheadpages *prometheus.Desc
bufManReadaheadtime *prometheus.Desc
bufManTargetpages *prometheus.Desc
// Win32_PerfRawData_{instance}_SQLServerDatabaseReplica
dbReplicaDatabaseFlowControlDelay *prometheus.Desc
dbReplicaDatabaseFlowControls *prometheus.Desc
dbReplicaFileBytesReceived *prometheus.Desc
dbReplicaGroupCommits *prometheus.Desc
dbReplicaGroupCommitTime *prometheus.Desc
dbReplicaLogApplyPendingQueue *prometheus.Desc
dbReplicaLogApplyReadyQueue *prometheus.Desc
dbReplicaLogBytesCompressed *prometheus.Desc
dbReplicaLogBytesDecompressed *prometheus.Desc
dbReplicaLogBytesReceived *prometheus.Desc
dbReplicaLogCompressionCachehits *prometheus.Desc
dbReplicaLogCompressionCachemisses *prometheus.Desc
dbReplicaLogCompressions *prometheus.Desc
dbReplicaLogDecompressions *prometheus.Desc
dbReplicaLogremainingforundo *prometheus.Desc
dbReplicaLogSendQueue *prometheus.Desc
dbReplicaMirroredWritetransactions *prometheus.Desc
dbReplicaRecoveryQueue *prometheus.Desc
dbReplicaRedoblocked *prometheus.Desc
dbReplicaRedoBytesRemaining *prometheus.Desc
dbReplicaRedoneBytes *prometheus.Desc
dbReplicaRedones *prometheus.Desc
dbReplicaTotalLogrequiringundo *prometheus.Desc
dbReplicaTransactionDelay *prometheus.Desc
// Win32_PerfRawData_{instance}_SQLServerDatabases
databasesActiveParallelredothreads *prometheus.Desc
databasesActiveTransactions *prometheus.Desc
databasesBackupPerRestoreThroughput *prometheus.Desc
databasesBulkCopyRows *prometheus.Desc
databasesBulkCopyThroughput *prometheus.Desc
databasesCommitTableEntries *prometheus.Desc
databasesDataFilesSizeKB *prometheus.Desc
databasesDBCCLogicalScanBytes *prometheus.Desc
databasesGroupCommitTime *prometheus.Desc
databasesLogBytesFlushed *prometheus.Desc
databasesLogCacheHits *prometheus.Desc
databasesLogCacheLookups *prometheus.Desc
databasesLogCacheReads *prometheus.Desc
databasesLogFilesSizeKB *prometheus.Desc
databasesLogFilesUsedSizeKB *prometheus.Desc
databasesLogFlushes *prometheus.Desc
databasesLogFlushWaits *prometheus.Desc
databasesLogFlushWaitTime *prometheus.Desc
databasesLogFlushWriteTimeMS *prometheus.Desc
databasesLogGrowths *prometheus.Desc
databasesLogPoolCacheMisses *prometheus.Desc
databasesLogPoolDiskReads *prometheus.Desc
databasesLogPoolHashDeletes *prometheus.Desc
databasesLogPoolHashInserts *prometheus.Desc
databasesLogPoolInvalidHashEntry *prometheus.Desc
databasesLogPoolLogScanPushes *prometheus.Desc
databasesLogPoolLogWriterPushes *prometheus.Desc
databasesLogPoolPushEmptyFreePool *prometheus.Desc
databasesLogPoolPushLowMemory *prometheus.Desc
databasesLogPoolPushNoFreeBuffer *prometheus.Desc
databasesLogPoolReqBehindTrunc *prometheus.Desc
databasesLogPoolRequestsOldVLF *prometheus.Desc
databasesLogPoolRequests *prometheus.Desc
databasesLogPoolTotalActiveLogSize *prometheus.Desc
databasesLogPoolTotalSharedPoolSize *prometheus.Desc
databasesLogShrinks *prometheus.Desc
databasesLogTruncations *prometheus.Desc
databasesPercentLogUsed *prometheus.Desc
databasesReplPendingXacts *prometheus.Desc
databasesReplTransRate *prometheus.Desc
databasesShrinkDataMovementBytes *prometheus.Desc
databasesTrackedTransactions *prometheus.Desc
databasesTransactions *prometheus.Desc
databasesWriteTransactions *prometheus.Desc
databasesXTPControllerDLCLatencyPerFetch *prometheus.Desc
databasesXTPControllerDLCPeakLatency *prometheus.Desc
databasesXTPControllerLogProcessed *prometheus.Desc
databasesXTPMemoryUsedKB *prometheus.Desc
// Win32_PerfRawData_{instance}_SQLServerGeneralStatistics
genStatsActiveTempTables *prometheus.Desc
genStatsConnectionReset *prometheus.Desc
genStatsEventNotificationsDelayedDrop *prometheus.Desc
genStatsHTTPAuthenticatedRequests *prometheus.Desc
genStatsLogicalConnections *prometheus.Desc
genStatsLogins *prometheus.Desc
genStatsLogouts *prometheus.Desc
genStatsMarsDeadlocks *prometheus.Desc
genStatsNonAtomicYieldRate *prometheus.Desc
genStatsProcessesBlocked *prometheus.Desc
genStatsSOAPEmptyRequests *prometheus.Desc
genStatsSOAPMethodInvocations *prometheus.Desc
genStatsSOAPSessionInitiateRequests *prometheus.Desc
genStatsSOAPSessionTerminateRequests *prometheus.Desc
genStatsSOAPSQLRequests *prometheus.Desc
genStatsSOAPWSDLRequests *prometheus.Desc
genStatsSQLTraceIOProviderLockWaits *prometheus.Desc
genStatsTempDBRecoveryUnitID *prometheus.Desc
genStatsTempDBrowSetID *prometheus.Desc
genStatsTempTablesCreationRate *prometheus.Desc
genStatsTempTablesForDestruction *prometheus.Desc
genStatsTraceEventNotificationQueue *prometheus.Desc
genStatsTransactions *prometheus.Desc
genStatsUserConnections *prometheus.Desc
// Win32_PerfRawData_{instance}_SQLServerLocks
locksWaitTime *prometheus.Desc
locksCount *prometheus.Desc
locksLockRequests *prometheus.Desc
locksLockTimeouts *prometheus.Desc
locksLockTimeoutstimeout0 *prometheus.Desc
locksLockWaits *prometheus.Desc
locksLockWaitTimeMS *prometheus.Desc
locksNumberOfDeadlocks *prometheus.Desc
// Win32_PerfRawData_{instance}_SQLServerMemoryManager
memMgrConnectionMemoryKB *prometheus.Desc
memMgrDatabaseCacheMemoryKB *prometheus.Desc
memMgrExternalbenefitofmemory *prometheus.Desc
memMgrFreeMemoryKB *prometheus.Desc
memMgrGrantedWorkspaceMemoryKB *prometheus.Desc
memMgrLockBlocks *prometheus.Desc
memMgrLockBlocksAllocated *prometheus.Desc
memMgrLockMemoryKB *prometheus.Desc
memMgrLockOwnerBlocks *prometheus.Desc
memMgrLockOwnerBlocksAllocated *prometheus.Desc
memMgrLogPoolMemoryKB *prometheus.Desc
memMgrMaximumWorkspaceMemoryKB *prometheus.Desc
memMgrMemoryGrantsOutstanding *prometheus.Desc
memMgrMemoryGrantsPending *prometheus.Desc
memMgrOptimizerMemoryKB *prometheus.Desc
memMgrReservedServerMemoryKB *prometheus.Desc
memMgrSQLCacheMemoryKB *prometheus.Desc
memMgrStolenServerMemoryKB *prometheus.Desc
memMgrTargetServerMemoryKB *prometheus.Desc
memMgrTotalServerMemoryKB *prometheus.Desc
// Win32_PerfRawData_{instance}_SQLServerSQLStatistics
sqlStatsAutoParamAttempts *prometheus.Desc
sqlStatsBatchRequests *prometheus.Desc
sqlStatsFailedAutoParams *prometheus.Desc
sqlStatsForcedParameterizations *prometheus.Desc
sqlStatsGuidedplanexecutions *prometheus.Desc
sqlStatsMisguidedplanexecutions *prometheus.Desc
sqlStatsSafeAutoParams *prometheus.Desc
sqlStatsSQLAttentionrate *prometheus.Desc
sqlStatsSQLCompilations *prometheus.Desc
sqlStatsSQLReCompilations *prometheus.Desc
sqlStatsUnsafeAutoParams *prometheus.Desc
// Win32_PerfRawData_{instance}_SQLServerSQLErrors
sqlErrorsTotal *prometheus.Desc
// Win32_PerfRawData_{instance}_SQLServerTransactions
transactionsTempDbFreeSpaceBytes *prometheus.Desc
transactionsLongestTransactionRunningSeconds *prometheus.Desc
transactionsNonSnapshotVersionActiveTotal *prometheus.Desc
transactionsSnapshotActiveTotal *prometheus.Desc
transactionsActive *prometheus.Desc
transactionsUpdateConflictsTotal *prometheus.Desc
transactionsUpdateSnapshotActiveTotal *prometheus.Desc
transactionsVersionCleanupRateBytes *prometheus.Desc
transactionsVersionGenerationRateBytes *prometheus.Desc
transactionsVersionStoreSizeBytes *prometheus.Desc
transactionsVersionStoreUnits *prometheus.Desc
transactionsVersionStoreCreationUnits *prometheus.Desc
transactionsVersionStoreTruncationUnits *prometheus.Desc
// Win32_PerfRawData_{instance}_SQLServerWaitStatistics
waitStatsLockWaits *prometheus.Desc
waitStatsMemoryGrantQueueWaits *prometheus.Desc
waitStatsThreadSafeMemoryObjectsWaits *prometheus.Desc
waitStatsLogWriteWaits *prometheus.Desc
waitStatsLogBufferWaits *prometheus.Desc
waitStatsNetworkIOWaits *prometheus.Desc
waitStatsPageIOLatchWaits *prometheus.Desc
waitStatsPageLatchWaits *prometheus.Desc
waitStatsNonPageLatchWaits *prometheus.Desc
waitStatsWaitForTheWorkerWaits *prometheus.Desc
waitStatsWorkspaceSynchronizationWaits *prometheus.Desc
waitStatsTransactionOwnershipWaits *prometheus.Desc
mssqlInstances mssqlInstancesType
mssqlCollectors mssqlCollectorsMap
mssqlChildCollectorFailure int
}
func New(logger log.Logger, config *Config) *Collector {
if config == nil {
config = &ConfigDefaults
}
printCollectors := false
c := &Collector{
mssqlEnabledCollectors: &config.EnabledCollectors,
mssqlPrintCollectors: &printCollectors,
}
c.SetLogger(logger)
return c
}
func NewWithFlags(app *kingpin.Application) *Collector {
return &Collector{
mssqlEnabledCollectors: app.Flag(
"collectors.mssql.classes-enabled",
"Comma-separated list of mssql WMI classes to use.").
Default(ConfigDefaults.EnabledCollectors).String(),
mssqlPrintCollectors: app.Flag(
"collectors.mssql.class-print",
"If true, print available mssql WMI classes and exit. Only displays if the mssql collector is enabled.",
).Bool(),
}
}
func (c *Collector) GetName() string {
return Name
}
func (c *Collector) SetLogger(logger log.Logger) {
c.logger = log.With(logger, "collector", Name)
}
func (c *Collector) GetPerfCounter() ([]string, error) {
enabled := utils.ExpandEnabledChildCollectors(*c.mssqlEnabledCollectors)
c.mssqlInstances = getMSSQLInstances(c.logger)
perfCounters := make([]string, 0, len(c.mssqlInstances)*len(enabled))
for instance := range c.mssqlInstances {
for _, c := range enabled {
perfCounters = append(perfCounters, mssqlGetPerfObjectName(instance, c))
}
}
return perfCounters, nil
}
func (c *Collector) Close() error {
return nil
}
func (c *Collector) Build() error {
// meta
c.mssqlScrapeDurationDesc = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "collector_duration_seconds"),
"windows_exporter: Duration of an mssql child collection.",
[]string{"collector", "mssql_instance"},
nil,
)
c.mssqlScrapeSuccessDesc = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "collector_success"),
"windows_exporter: Whether a mssql child collector was successful.",
[]string{"collector", "mssql_instance"},
nil,
)
// Win32_PerfRawData_{instance}_SQLServerAccessMethods
c.accessMethodsAUcleanupbatches = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_au_batch_cleanups"),
"(AccessMethods.AUcleanupbatches)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsAUcleanups = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_au_cleanups"),
"(AccessMethods.AUcleanups)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsByReferenceLobCreateCount = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_by_reference_lob_creates"),
"(AccessMethods.ByreferenceLobCreateCount)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsByReferenceLobUseCount = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_by_reference_lob_uses"),
"(AccessMethods.ByreferenceLobUseCount)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsCountLobReadahead = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_lob_read_aheads"),
"(AccessMethods.CountLobReadahead)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsCountPullInRow = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_column_value_pulls"),
"(AccessMethods.CountPullInRow)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsCountPushOffRow = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_column_value_pushes"),
"(AccessMethods.CountPushOffRow)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsDeferreddroppedAUs = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_deferred_dropped_aus"),
"(AccessMethods.DeferreddroppedAUs)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsDeferredDroppedrowsets = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_deferred_dropped_rowsets"),
"(AccessMethods.DeferredDroppedrowsets)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsDroppedrowsetcleanups = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_dropped_rowset_cleanups"),
"(AccessMethods.Droppedrowsetcleanups)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsDroppedrowsetsskipped = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_dropped_rowset_skips"),
"(AccessMethods.Droppedrowsetsskipped)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsExtentDeallocations = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_extent_deallocations"),
"(AccessMethods.ExtentDeallocations)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsExtentsAllocated = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_extent_allocations"),
"(AccessMethods.ExtentsAllocated)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsFailedAUcleanupbatches = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_au_batch_cleanup_failures"),
"(AccessMethods.FailedAUcleanupbatches)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsFailedleafpagecookie = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_leaf_page_cookie_failures"),
"(AccessMethods.Failedleafpagecookie)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsFailedtreepagecookie = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_tree_page_cookie_failures"),
"(AccessMethods.Failedtreepagecookie)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsForwardedRecords = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_forwarded_records"),
"(AccessMethods.ForwardedRecords)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsFreeSpacePageFetches = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_free_space_page_fetches"),
"(AccessMethods.FreeSpacePageFetches)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsFreeSpaceScans = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_free_space_scans"),
"(AccessMethods.FreeSpaceScans)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsFullScans = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_full_scans"),
"(AccessMethods.FullScans)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsIndexSearches = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_index_searches"),
"(AccessMethods.IndexSearches)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsInSysXactwaits = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_insysxact_waits"),
"(AccessMethods.InSysXactwaits)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsLobHandleCreateCount = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_lob_handle_creates"),
"(AccessMethods.LobHandleCreateCount)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsLobHandleDestroyCount = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_lob_handle_destroys"),
"(AccessMethods.LobHandleDestroyCount)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsLobSSProviderCreateCount = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_lob_ss_provider_creates"),
"(AccessMethods.LobSSProviderCreateCount)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsLobSSProviderDestroyCount = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_lob_ss_provider_destroys"),
"(AccessMethods.LobSSProviderDestroyCount)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsLobSSProviderTruncationCount = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_lob_ss_provider_truncations"),
"(AccessMethods.LobSSProviderTruncationCount)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsMixedPageAllocations = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_mixed_page_allocations"),
"(AccessMethods.MixedpageallocationsPersec)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsPageCompressionAttempts = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_page_compression_attempts"),
"(AccessMethods.PagecompressionattemptsPersec)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsPageDeallocations = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_page_deallocations"),
"(AccessMethods.PageDeallocationsPersec)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsPagesAllocated = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_page_allocations"),
"(AccessMethods.PagesAllocatedPersec)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsPagesCompressed = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_page_compressions"),
"(AccessMethods.PagescompressedPersec)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsPageSplits = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_page_splits"),
"(AccessMethods.PageSplitsPersec)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsProbeScans = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_probe_scans"),
"(AccessMethods.ProbeScansPersec)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsRangeScans = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_range_scans"),
"(AccessMethods.RangeScansPersec)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsScanPointRevalidations = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_scan_point_revalidations"),
"(AccessMethods.ScanPointRevalidationsPersec)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsSkippedGhostedRecords = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_ghost_record_skips"),
"(AccessMethods.SkippedGhostedRecordsPersec)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsTableLockEscalations = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_table_lock_escalations"),
"(AccessMethods.TableLockEscalationsPersec)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsUsedleafpagecookie = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_leaf_page_cookie_uses"),
"(AccessMethods.Usedleafpagecookie)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsUsedtreepagecookie = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_tree_page_cookie_uses"),
"(AccessMethods.Usedtreepagecookie)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsWorkfilesCreated = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_workfile_creates"),
"(AccessMethods.WorkfilesCreatedPersec)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsWorktablesCreated = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_worktables_creates"),
"(AccessMethods.WorktablesCreatedPersec)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsWorktablesFromCacheHits = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_worktables_from_cache_hits"),
"(AccessMethods.WorktablesFromCacheRatio)",
[]string{"mssql_instance"},
nil,
)
c.accessMethodsWorktablesFromCacheLookups = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "accessmethods_worktables_from_cache_lookups"),
"(AccessMethods.WorktablesFromCacheRatio_Base)",
[]string{"mssql_instance"},
nil,
)
// Win32_PerfRawData_{instance}_SQLServerAvailabilityReplica
c.availReplicaBytesReceivedFromReplica = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "availreplica_received_from_replica_bytes"),
"(AvailabilityReplica.BytesReceivedfromReplica)",
[]string{"mssql_instance", "replica"},
nil,
)
c.availReplicaBytesSentToReplica = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "availreplica_sent_to_replica_bytes"),
"(AvailabilityReplica.BytesSenttoReplica)",
[]string{"mssql_instance", "replica"},
nil,
)
c.availReplicaBytesSentToTransport = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "availreplica_sent_to_transport_bytes"),
"(AvailabilityReplica.BytesSenttoTransport)",
[]string{"mssql_instance", "replica"},
nil,
)
c.availReplicaFlowControl = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "availreplica_initiated_flow_controls"),
"(AvailabilityReplica.FlowControl)",
[]string{"mssql_instance", "replica"},
nil,
)
c.availReplicaFlowControlTimeMS = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "availreplica_flow_control_wait_seconds"),
"(AvailabilityReplica.FlowControlTimems)",
[]string{"mssql_instance", "replica"},
nil,
)
c.availReplicaReceivesFromReplica = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "availreplica_receives_from_replica"),
"(AvailabilityReplica.ReceivesfromReplica)",
[]string{"mssql_instance", "replica"},
nil,
)
c.availReplicaResentMessages = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "availreplica_resent_messages"),
"(AvailabilityReplica.ResentMessages)",
[]string{"mssql_instance", "replica"},
nil,
)
c.availReplicaSendsToReplica = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "availreplica_sends_to_replica"),
"(AvailabilityReplica.SendstoReplica)",
[]string{"mssql_instance", "replica"},
nil,
)
c.availReplicaSendsToTransport = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "availreplica_sends_to_transport"),
"(AvailabilityReplica.SendstoTransport)",
[]string{"mssql_instance", "replica"},
nil,
)
// Win32_PerfRawData_{instance}_SQLServerBufferManager
c.bufManBackgroundwriterpages = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_background_writer_pages"),
"(BufferManager.Backgroundwriterpages)",
[]string{"mssql_instance"},
nil,
)
c.bufManBuffercachehits = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_buffer_cache_hits"),
"(BufferManager.Buffercachehitratio)",
[]string{"mssql_instance"},
nil,
)
c.bufManBuffercachelookups = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_buffer_cache_lookups"),
"(BufferManager.Buffercachehitratio_Base)",
[]string{"mssql_instance"},
nil,
)
c.bufManCheckpointpages = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_checkpoint_pages"),
"(BufferManager.Checkpointpages)",
[]string{"mssql_instance"},
nil,
)
c.bufManDatabasepages = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_database_pages"),
"(BufferManager.Databasepages)",
[]string{"mssql_instance"},
nil,
)
c.bufManExtensionallocatedpages = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_extension_allocated_pages"),
"(BufferManager.Extensionallocatedpages)",
[]string{"mssql_instance"},
nil,
)
c.bufManExtensionfreepages = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_extension_free_pages"),
"(BufferManager.Extensionfreepages)",
[]string{"mssql_instance"},
nil,
)
c.bufManExtensioninuseaspercentage = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_extension_in_use_as_percentage"),
"(BufferManager.Extensioninuseaspercentage)",
[]string{"mssql_instance"},
nil,
)
c.bufManExtensionoutstandingIOcounter = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_extension_outstanding_io"),
"(BufferManager.ExtensionoutstandingIOcounter)",
[]string{"mssql_instance"},
nil,
)
c.bufManExtensionpageevictions = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_extension_page_evictions"),
"(BufferManager.Extensionpageevictions)",
[]string{"mssql_instance"},
nil,
)
c.bufManExtensionpagereads = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_extension_page_reads"),
"(BufferManager.Extensionpagereads)",
[]string{"mssql_instance"},
nil,
)
c.bufManExtensionpageunreferencedtime = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_extension_page_unreferenced_seconds"),
"(BufferManager.Extensionpageunreferencedtime)",
[]string{"mssql_instance"},
nil,
)
c.bufManExtensionpagewrites = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_extension_page_writes"),
"(BufferManager.Extensionpagewrites)",
[]string{"mssql_instance"},
nil,
)
c.bufManFreeliststalls = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_free_list_stalls"),
"(BufferManager.Freeliststalls)",
[]string{"mssql_instance"},
nil,
)
c.bufManIntegralControllerSlope = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_integral_controller_slope"),
"(BufferManager.IntegralControllerSlope)",
[]string{"mssql_instance"},
nil,
)
c.bufManLazywrites = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_lazywrites"),
"(BufferManager.Lazywrites)",
[]string{"mssql_instance"},
nil,
)
c.bufManPagelifeexpectancy = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_page_life_expectancy_seconds"),
"(BufferManager.Pagelifeexpectancy)",
[]string{"mssql_instance"},
nil,
)
c.bufManPagelookups = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_page_lookups"),
"(BufferManager.Pagelookups)",
[]string{"mssql_instance"},
nil,
)
c.bufManPagereads = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_page_reads"),
"(BufferManager.Pagereads)",
[]string{"mssql_instance"},
nil,
)
c.bufManPagewrites = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_page_writes"),
"(BufferManager.Pagewrites)",
[]string{"mssql_instance"},
nil,
)
c.bufManReadaheadpages = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_read_ahead_pages"),
"(BufferManager.Readaheadpages)",
[]string{"mssql_instance"},
nil,
)
c.bufManReadaheadtime = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_read_ahead_issuing_seconds"),
"(BufferManager.Readaheadtime)",
[]string{"mssql_instance"},
nil,
)
c.bufManTargetpages = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "bufman_target_pages"),
"(BufferManager.Targetpages)",
[]string{"mssql_instance"},
nil,
)
// Win32_PerfRawData_{instance}_SQLServerDatabaseReplica
c.dbReplicaDatabaseFlowControlDelay = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "dbreplica_database_flow_control_wait_seconds"),
"(DatabaseReplica.DatabaseFlowControlDelay)",
[]string{"mssql_instance", "replica"},
nil,
)
c.dbReplicaDatabaseFlowControls = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "dbreplica_database_initiated_flow_controls"),
"(DatabaseReplica.DatabaseFlowControls)",
[]string{"mssql_instance", "replica"},
nil,
)
c.dbReplicaFileBytesReceived = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "dbreplica_received_file_bytes"),
"(DatabaseReplica.FileBytesReceived)",
[]string{"mssql_instance", "replica"},
nil,
)
c.dbReplicaGroupCommits = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "dbreplica_group_commits"),
"(DatabaseReplica.GroupCommits)",
[]string{"mssql_instance", "replica"},
nil,
)
c.dbReplicaGroupCommitTime = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "dbreplica_group_commit_stall_seconds"),
"(DatabaseReplica.GroupCommitTime)",
[]string{"mssql_instance", "replica"},
nil,
)
c.dbReplicaLogApplyPendingQueue = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "dbreplica_log_apply_pending_queue"),
"(DatabaseReplica.LogApplyPendingQueue)",
[]string{"mssql_instance", "replica"},
nil,
)
c.dbReplicaLogApplyReadyQueue = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "dbreplica_log_apply_ready_queue"),
"(DatabaseReplica.LogApplyReadyQueue)",
[]string{"mssql_instance", "replica"},
nil,
)
c.dbReplicaLogBytesCompressed = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "dbreplica_log_compressed_bytes"),
"(DatabaseReplica.LogBytesCompressed)",
[]string{"mssql_instance", "replica"},
nil,
)
c.dbReplicaLogBytesDecompressed = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "dbreplica_log_decompressed_bytes"),
"(DatabaseReplica.LogBytesDecompressed)",
[]string{"mssql_instance", "replica"},
nil,
)
c.dbReplicaLogBytesReceived = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "dbreplica_log_received_bytes"),
"(DatabaseReplica.LogBytesReceived)",
[]string{"mssql_instance", "replica"},
nil,
)
c.dbReplicaLogCompressionCachehits = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "dbreplica_log_compression_cachehits"),