2024-05-11 16:06:03 +00:00
|
|
|
//go:build windows
|
|
|
|
|
|
|
|
package smbclient
|
|
|
|
|
|
|
|
import (
|
2024-09-10 22:34:10 +00:00
|
|
|
"log/slog"
|
2024-05-11 16:06:03 +00:00
|
|
|
"strings"
|
|
|
|
|
|
|
|
"github.com/alecthomas/kingpin/v2"
|
2024-10-05 19:33:40 +00:00
|
|
|
"github.com/prometheus-community/windows_exporter/internal/perfdata/perftypes"
|
|
|
|
v1 "github.com/prometheus-community/windows_exporter/internal/perfdata/v1"
|
2024-10-03 18:34:45 +00:00
|
|
|
"github.com/prometheus-community/windows_exporter/internal/types"
|
2024-05-11 16:06:03 +00:00
|
|
|
"github.com/prometheus/client_golang/prometheus"
|
2024-08-29 22:26:15 +00:00
|
|
|
"github.com/yusufpapurcu/wmi"
|
2024-05-11 16:06:03 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2024-08-05 13:50:41 +00:00
|
|
|
Name = "smbclient"
|
2024-05-11 16:06:03 +00:00
|
|
|
)
|
|
|
|
|
2024-08-11 11:28:39 +00:00
|
|
|
type Config struct{}
|
2024-05-11 16:06:03 +00:00
|
|
|
|
2024-08-11 11:28:39 +00:00
|
|
|
var ConfigDefaults = Config{}
|
2024-05-11 16:06:03 +00:00
|
|
|
|
2024-08-05 13:50:41 +00:00
|
|
|
type Collector struct {
|
2024-08-11 11:28:39 +00:00
|
|
|
config Config
|
2024-05-11 16:06:03 +00:00
|
|
|
|
2024-08-10 18:02:07 +00:00
|
|
|
readBytesTotal *prometheus.Desc
|
|
|
|
readBytesTransmittedViaSMBDirectTotal *prometheus.Desc
|
|
|
|
readRequestQueueSecsTotal *prometheus.Desc
|
|
|
|
readRequestsTransmittedViaSMBDirectTotal *prometheus.Desc
|
|
|
|
readSecsTotal *prometheus.Desc
|
|
|
|
readsTotal *prometheus.Desc
|
|
|
|
turboIOReadsTotal *prometheus.Desc
|
|
|
|
TurboIOWritesTotal *prometheus.Desc
|
|
|
|
writeBytesTotal *prometheus.Desc
|
|
|
|
writeBytesTransmittedViaSMBDirectTotal *prometheus.Desc
|
|
|
|
writeRequestQueueSecsTotal *prometheus.Desc
|
|
|
|
writeRequestsTransmittedViaSMBDirectTotal *prometheus.Desc
|
|
|
|
writeSecsTotal *prometheus.Desc
|
|
|
|
writesTotal *prometheus.Desc
|
|
|
|
|
|
|
|
creditStallsTotal *prometheus.Desc
|
|
|
|
currentDataQueued *prometheus.Desc
|
|
|
|
dataBytesTotal *prometheus.Desc
|
|
|
|
dataRequestsTotal *prometheus.Desc
|
|
|
|
metadataRequestsTotal *prometheus.Desc
|
|
|
|
requestQueueSecsTotal *prometheus.Desc
|
|
|
|
requestSecs *prometheus.Desc
|
2024-05-11 16:06:03 +00:00
|
|
|
}
|
|
|
|
|
2024-08-24 17:14:38 +00:00
|
|
|
func New(config *Config) *Collector {
|
2024-05-11 16:06:03 +00:00
|
|
|
if config == nil {
|
|
|
|
config = &ConfigDefaults
|
|
|
|
}
|
|
|
|
|
2024-08-05 13:50:41 +00:00
|
|
|
c := &Collector{
|
2024-08-11 11:28:39 +00:00
|
|
|
config: *config,
|
2024-05-11 16:06:03 +00:00
|
|
|
}
|
2024-08-11 11:28:39 +00:00
|
|
|
|
2024-05-11 16:06:03 +00:00
|
|
|
return c
|
|
|
|
}
|
|
|
|
|
2024-08-11 11:28:39 +00:00
|
|
|
func NewWithFlags(_ *kingpin.Application) *Collector {
|
|
|
|
return &Collector{}
|
2024-05-11 16:06:03 +00:00
|
|
|
}
|
|
|
|
|
2024-08-05 13:50:41 +00:00
|
|
|
func (c *Collector) GetName() string {
|
2024-05-11 16:06:03 +00:00
|
|
|
return Name
|
|
|
|
}
|
|
|
|
|
2024-09-10 22:34:10 +00:00
|
|
|
func (c *Collector) GetPerfCounter(_ *slog.Logger) ([]string, error) {
|
2024-05-11 16:06:03 +00:00
|
|
|
return []string{
|
|
|
|
"SMB Client Shares",
|
|
|
|
}, nil
|
|
|
|
}
|
|
|
|
|
2024-09-10 22:34:10 +00:00
|
|
|
func (c *Collector) Close(_ *slog.Logger) error {
|
2024-08-05 13:50:41 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2024-09-10 22:34:10 +00:00
|
|
|
func (c *Collector) Build(_ *slog.Logger, _ *wmi.Client) error {
|
2024-05-11 16:06:03 +00:00
|
|
|
// desc creates a new prometheus description
|
|
|
|
desc := func(metricName string, description string, labels []string) *prometheus.Desc {
|
|
|
|
return prometheus.NewDesc(
|
2024-10-03 18:34:45 +00:00
|
|
|
prometheus.BuildFQName(types.Namespace, "smbclient", metricName),
|
2024-05-11 16:06:03 +00:00
|
|
|
description,
|
|
|
|
labels,
|
|
|
|
nil,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2024-08-10 18:02:07 +00:00
|
|
|
c.requestQueueSecsTotal = desc("data_queue_seconds_total",
|
2024-05-11 16:06:03 +00:00
|
|
|
"Seconds requests waited on queue on this share",
|
|
|
|
[]string{"server", "share"},
|
|
|
|
)
|
2024-08-10 18:02:07 +00:00
|
|
|
c.readRequestQueueSecsTotal = desc("read_queue_seconds_total",
|
2024-05-11 16:06:03 +00:00
|
|
|
"Seconds read requests waited on queue on this share",
|
|
|
|
[]string{"server", "share"},
|
|
|
|
)
|
2024-08-10 18:02:07 +00:00
|
|
|
c.writeRequestQueueSecsTotal = desc("write_queue_seconds_total",
|
2024-05-11 16:06:03 +00:00
|
|
|
"Seconds write requests waited on queue on this share",
|
|
|
|
[]string{"server", "share"},
|
|
|
|
)
|
2024-08-10 18:02:07 +00:00
|
|
|
c.requestSecs = desc("request_seconds_total",
|
2024-05-11 16:06:03 +00:00
|
|
|
"Seconds waiting for requests on this share",
|
|
|
|
[]string{"server", "share"},
|
|
|
|
)
|
2024-08-10 18:02:07 +00:00
|
|
|
c.creditStallsTotal = desc("stalls_total",
|
2024-05-11 16:06:03 +00:00
|
|
|
"The number of requests delayed based on insufficient credits on this share",
|
|
|
|
[]string{"server", "share"},
|
|
|
|
)
|
2024-08-10 18:02:07 +00:00
|
|
|
c.currentDataQueued = desc("requests_queued",
|
2024-05-11 16:06:03 +00:00
|
|
|
"The point in time number of requests outstanding on this share",
|
|
|
|
[]string{"server", "share"},
|
|
|
|
)
|
2024-08-10 18:02:07 +00:00
|
|
|
c.dataBytesTotal = desc("data_bytes_total",
|
2024-05-11 16:06:03 +00:00
|
|
|
"The bytes read or written on this share",
|
|
|
|
[]string{"server", "share"},
|
|
|
|
)
|
2024-08-10 18:02:07 +00:00
|
|
|
c.dataRequestsTotal = desc("requests_total",
|
2024-05-11 16:06:03 +00:00
|
|
|
"The requests on this share",
|
|
|
|
[]string{"server", "share"},
|
|
|
|
)
|
2024-08-10 18:02:07 +00:00
|
|
|
c.metadataRequestsTotal = desc("metadata_requests_total",
|
2024-05-11 16:06:03 +00:00
|
|
|
"The metadata requests on this share",
|
|
|
|
[]string{"server", "share"},
|
|
|
|
)
|
2024-08-10 18:02:07 +00:00
|
|
|
c.readBytesTransmittedViaSMBDirectTotal = desc("read_bytes_via_smbdirect_total",
|
2024-05-11 16:06:03 +00:00
|
|
|
"The bytes read from this share via RDMA direct placement",
|
|
|
|
[]string{"server", "share"},
|
|
|
|
)
|
2024-08-10 18:02:07 +00:00
|
|
|
c.readBytesTotal = desc("read_bytes_total",
|
2024-05-11 16:06:03 +00:00
|
|
|
"The bytes read on this share",
|
|
|
|
[]string{"server", "share"},
|
|
|
|
)
|
2024-08-10 18:02:07 +00:00
|
|
|
c.readRequestsTransmittedViaSMBDirectTotal = desc("read_requests_via_smbdirect_total",
|
2024-05-11 16:06:03 +00:00
|
|
|
"The read requests on this share via RDMA direct placement",
|
|
|
|
[]string{"server", "share"},
|
|
|
|
)
|
2024-08-10 18:02:07 +00:00
|
|
|
c.readsTotal = desc("read_requests_total",
|
2024-05-11 16:06:03 +00:00
|
|
|
"The read requests on this share",
|
|
|
|
[]string{"server", "share"},
|
|
|
|
)
|
2024-08-10 18:02:07 +00:00
|
|
|
c.turboIOReadsTotal = desc("turbo_io_reads_total",
|
2024-05-11 16:06:03 +00:00
|
|
|
"The read requests that go through Turbo I/O",
|
|
|
|
[]string{"server", "share"},
|
|
|
|
)
|
|
|
|
c.TurboIOWritesTotal = desc("turbo_io_writes_total",
|
|
|
|
"The write requests that go through Turbo I/O",
|
|
|
|
[]string{"server", "share"},
|
|
|
|
)
|
2024-08-10 18:02:07 +00:00
|
|
|
c.writeBytesTransmittedViaSMBDirectTotal = desc("write_bytes_via_smbdirect_total",
|
2024-05-11 16:06:03 +00:00
|
|
|
"The written bytes to this share via RDMA direct placement",
|
|
|
|
[]string{"server", "share"},
|
|
|
|
)
|
2024-08-10 18:02:07 +00:00
|
|
|
c.writeBytesTotal = desc("write_bytes_total",
|
2024-05-11 16:06:03 +00:00
|
|
|
"The bytes written on this share",
|
|
|
|
[]string{"server", "share"},
|
|
|
|
)
|
2024-08-10 18:02:07 +00:00
|
|
|
c.writeRequestsTransmittedViaSMBDirectTotal = desc("write_requests_via_smbdirect_total",
|
2024-05-11 16:06:03 +00:00
|
|
|
"The write requests to this share via RDMA direct placement",
|
|
|
|
[]string{"server", "share"},
|
|
|
|
)
|
2024-08-10 18:02:07 +00:00
|
|
|
c.writesTotal = desc("write_requests_total",
|
2024-05-11 16:06:03 +00:00
|
|
|
"The write requests on this share",
|
|
|
|
[]string{"server", "share"},
|
|
|
|
)
|
2024-08-10 18:02:07 +00:00
|
|
|
c.readSecsTotal = desc("read_seconds_total",
|
2024-05-11 16:06:03 +00:00
|
|
|
"Seconds waiting for read requests on this share",
|
|
|
|
[]string{"server", "share"},
|
|
|
|
)
|
2024-08-10 18:02:07 +00:00
|
|
|
c.writeSecsTotal = desc("write_seconds_total",
|
2024-05-11 16:06:03 +00:00
|
|
|
"Seconds waiting for write requests on this share",
|
|
|
|
[]string{"server", "share"},
|
|
|
|
)
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2024-08-10 20:05:33 +00:00
|
|
|
// Collect collects smb client metrics and sends them to prometheus.
|
2024-10-03 18:34:45 +00:00
|
|
|
func (c *Collector) Collect(ctx *types.ScrapeContext, logger *slog.Logger, ch chan<- prometheus.Metric) error {
|
2024-09-10 22:34:10 +00:00
|
|
|
logger = logger.With(slog.String("collector", Name))
|
2024-08-24 17:14:38 +00:00
|
|
|
if err := c.collectClientShares(ctx, logger, ch); err != nil {
|
2024-09-10 22:34:10 +00:00
|
|
|
logger.Error("Error in ClientShares",
|
|
|
|
slog.Any("err", err),
|
|
|
|
)
|
|
|
|
|
2024-08-11 11:28:39 +00:00
|
|
|
return err
|
2024-05-11 16:06:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2024-08-10 20:05:33 +00:00
|
|
|
// Perflib: SMB Client Shares.
|
2024-05-11 16:06:03 +00:00
|
|
|
type perflibClientShares struct {
|
|
|
|
Name string
|
|
|
|
|
|
|
|
AvgDataQueueLength float64 `perflib:"Avg. Data Queue Length"`
|
|
|
|
AvgReadQueueLength float64 `perflib:"Avg. Read Queue Length"`
|
|
|
|
AvgSecPerRead float64 `perflib:"Avg. sec/Read"`
|
|
|
|
AvgSecPerWrite float64 `perflib:"Avg. sec/Write"`
|
|
|
|
AvgSecPerDataRequest float64 `perflib:"Avg. sec/Data Request"`
|
|
|
|
AvgWriteQueueLength float64 `perflib:"Avg. Write Queue Length"`
|
|
|
|
CreditStallsPerSec float64 `perflib:"Credit Stalls/sec"`
|
|
|
|
CurrentDataQueueLength float64 `perflib:"Current Data Queue Length"`
|
|
|
|
DataBytesPerSec float64 `perflib:"Data Bytes/sec"`
|
|
|
|
DataRequestsPerSec float64 `perflib:"Data Requests/sec"`
|
|
|
|
MetadataRequestsPerSec float64 `perflib:"Metadata Requests/sec"`
|
|
|
|
ReadBytesTransmittedViaSMBDirectPerSec float64 `perflib:"Read Bytes transmitted via SMB Direct/sec"`
|
|
|
|
ReadBytesPerSec float64 `perflib:"Read Bytes/sec"`
|
|
|
|
ReadRequestsTransmittedViaSMBDirectPerSec float64 `perflib:"Read Requests transmitted via SMB Direct/sec"`
|
|
|
|
ReadRequestsPerSec float64 `perflib:"Read Requests/sec"`
|
|
|
|
TurboIOReadsPerSec float64 `perflib:"Turbo I/O Reads/sec"`
|
|
|
|
TurboIOWritesPerSec float64 `perflib:"Turbo I/O Writes/sec"`
|
|
|
|
WriteBytesTransmittedViaSMBDirectPerSec float64 `perflib:"Write Bytes transmitted via SMB Direct/sec"`
|
|
|
|
WriteBytesPerSec float64 `perflib:"Write Bytes/sec"`
|
|
|
|
WriteRequestsTransmittedViaSMBDirectPerSec float64 `perflib:"Write Requests transmitted via SMB Direct/sec"`
|
|
|
|
WriteRequestsPerSec float64 `perflib:"Write Requests/sec"`
|
|
|
|
}
|
|
|
|
|
2024-10-03 18:34:45 +00:00
|
|
|
func (c *Collector) collectClientShares(ctx *types.ScrapeContext, logger *slog.Logger, ch chan<- prometheus.Metric) error {
|
2024-09-10 22:34:10 +00:00
|
|
|
logger = logger.With(slog.String("collector", Name))
|
|
|
|
|
2024-05-11 16:06:03 +00:00
|
|
|
var data []perflibClientShares
|
2024-09-10 22:34:10 +00:00
|
|
|
|
2024-10-05 19:33:40 +00:00
|
|
|
if err := v1.UnmarshalObject(ctx.PerfObjects["SMB Client Shares"], &data, logger); err != nil {
|
2024-05-11 16:06:03 +00:00
|
|
|
return err
|
|
|
|
}
|
2024-09-10 22:34:10 +00:00
|
|
|
|
2024-05-11 16:06:03 +00:00
|
|
|
for _, instance := range data {
|
|
|
|
if instance.Name == "_Total" {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
|
|
|
parsed := strings.FieldsFunc(instance.Name, func(r rune) bool { return r == '\\' })
|
|
|
|
serverValue := parsed[0]
|
|
|
|
shareValue := parsed[1]
|
|
|
|
// Request time spent on queue. Convert from ticks to seconds.
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
2024-08-10 18:02:07 +00:00
|
|
|
c.requestQueueSecsTotal,
|
2024-05-11 16:06:03 +00:00
|
|
|
prometheus.CounterValue,
|
2024-10-05 19:33:40 +00:00
|
|
|
instance.AvgDataQueueLength*perftypes.TicksToSecondScaleFactor,
|
2024-05-11 16:06:03 +00:00
|
|
|
serverValue, shareValue,
|
|
|
|
)
|
|
|
|
|
|
|
|
// Read time spent on queue. Convert from ticks to seconds.
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
2024-08-10 18:02:07 +00:00
|
|
|
c.readRequestQueueSecsTotal,
|
2024-05-11 16:06:03 +00:00
|
|
|
prometheus.CounterValue,
|
2024-10-05 19:33:40 +00:00
|
|
|
instance.AvgReadQueueLength*perftypes.TicksToSecondScaleFactor,
|
2024-05-11 16:06:03 +00:00
|
|
|
serverValue, shareValue,
|
|
|
|
)
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
2024-08-10 18:02:07 +00:00
|
|
|
c.readSecsTotal,
|
2024-05-11 16:06:03 +00:00
|
|
|
prometheus.CounterValue,
|
2024-10-05 19:33:40 +00:00
|
|
|
instance.AvgSecPerRead*perftypes.TicksToSecondScaleFactor,
|
2024-05-11 16:06:03 +00:00
|
|
|
serverValue, shareValue,
|
|
|
|
)
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
2024-08-10 18:02:07 +00:00
|
|
|
c.writeSecsTotal,
|
2024-05-11 16:06:03 +00:00
|
|
|
prometheus.CounterValue,
|
2024-10-05 19:33:40 +00:00
|
|
|
instance.AvgSecPerWrite*perftypes.TicksToSecondScaleFactor,
|
2024-05-11 16:06:03 +00:00
|
|
|
serverValue, shareValue,
|
|
|
|
)
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
2024-08-10 18:02:07 +00:00
|
|
|
c.requestSecs,
|
2024-05-11 16:06:03 +00:00
|
|
|
prometheus.CounterValue,
|
2024-10-05 19:33:40 +00:00
|
|
|
instance.AvgSecPerDataRequest*perftypes.TicksToSecondScaleFactor,
|
2024-05-11 16:06:03 +00:00
|
|
|
serverValue, shareValue,
|
|
|
|
)
|
|
|
|
|
|
|
|
// Write time spent on queue. Convert from ticks to seconds.
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
2024-08-10 18:02:07 +00:00
|
|
|
c.writeRequestQueueSecsTotal,
|
2024-05-11 16:06:03 +00:00
|
|
|
prometheus.CounterValue,
|
2024-10-05 19:33:40 +00:00
|
|
|
instance.AvgWriteQueueLength*perftypes.TicksToSecondScaleFactor,
|
2024-05-11 16:06:03 +00:00
|
|
|
serverValue, shareValue,
|
|
|
|
)
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
2024-08-10 18:02:07 +00:00
|
|
|
c.creditStallsTotal,
|
2024-05-11 16:06:03 +00:00
|
|
|
prometheus.CounterValue,
|
|
|
|
instance.CreditStallsPerSec,
|
|
|
|
serverValue, shareValue,
|
|
|
|
)
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
2024-08-10 18:02:07 +00:00
|
|
|
c.currentDataQueued,
|
2024-05-11 16:06:03 +00:00
|
|
|
prometheus.GaugeValue,
|
|
|
|
instance.CurrentDataQueueLength,
|
|
|
|
serverValue, shareValue,
|
|
|
|
)
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
2024-08-10 18:02:07 +00:00
|
|
|
c.dataBytesTotal,
|
2024-05-11 16:06:03 +00:00
|
|
|
prometheus.CounterValue,
|
|
|
|
instance.DataBytesPerSec,
|
|
|
|
serverValue, shareValue,
|
|
|
|
)
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
2024-08-10 18:02:07 +00:00
|
|
|
c.dataRequestsTotal,
|
2024-05-11 16:06:03 +00:00
|
|
|
prometheus.CounterValue,
|
|
|
|
instance.DataRequestsPerSec,
|
|
|
|
serverValue, shareValue,
|
|
|
|
)
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
2024-08-10 18:02:07 +00:00
|
|
|
c.metadataRequestsTotal,
|
2024-05-11 16:06:03 +00:00
|
|
|
prometheus.CounterValue,
|
|
|
|
instance.MetadataRequestsPerSec,
|
|
|
|
serverValue, shareValue,
|
|
|
|
)
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
2024-08-10 18:02:07 +00:00
|
|
|
c.readBytesTransmittedViaSMBDirectTotal,
|
2024-05-11 16:06:03 +00:00
|
|
|
prometheus.CounterValue,
|
|
|
|
instance.ReadBytesTransmittedViaSMBDirectPerSec,
|
|
|
|
serverValue, shareValue,
|
|
|
|
)
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
2024-08-10 18:02:07 +00:00
|
|
|
c.readBytesTotal,
|
2024-05-11 16:06:03 +00:00
|
|
|
prometheus.CounterValue,
|
|
|
|
instance.ReadBytesPerSec,
|
|
|
|
serverValue, shareValue,
|
|
|
|
)
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
2024-08-10 18:02:07 +00:00
|
|
|
c.readRequestsTransmittedViaSMBDirectTotal,
|
2024-05-11 16:06:03 +00:00
|
|
|
prometheus.CounterValue,
|
|
|
|
instance.ReadRequestsTransmittedViaSMBDirectPerSec,
|
|
|
|
serverValue, shareValue,
|
|
|
|
)
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
2024-08-10 18:02:07 +00:00
|
|
|
c.readsTotal,
|
2024-05-11 16:06:03 +00:00
|
|
|
prometheus.CounterValue,
|
|
|
|
instance.ReadRequestsPerSec,
|
|
|
|
serverValue, shareValue,
|
|
|
|
)
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
2024-08-10 18:02:07 +00:00
|
|
|
c.turboIOReadsTotal,
|
2024-05-11 16:06:03 +00:00
|
|
|
prometheus.CounterValue,
|
|
|
|
instance.TurboIOReadsPerSec,
|
|
|
|
serverValue, shareValue,
|
|
|
|
)
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
|
|
|
c.TurboIOWritesTotal,
|
|
|
|
prometheus.CounterValue,
|
|
|
|
instance.TurboIOWritesPerSec,
|
|
|
|
serverValue, shareValue,
|
|
|
|
)
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
2024-08-10 18:02:07 +00:00
|
|
|
c.writeBytesTransmittedViaSMBDirectTotal,
|
2024-05-11 16:06:03 +00:00
|
|
|
prometheus.CounterValue,
|
|
|
|
instance.WriteBytesTransmittedViaSMBDirectPerSec,
|
|
|
|
serverValue, shareValue,
|
|
|
|
)
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
2024-08-10 18:02:07 +00:00
|
|
|
c.writeBytesTotal,
|
2024-05-11 16:06:03 +00:00
|
|
|
prometheus.CounterValue,
|
|
|
|
instance.WriteBytesPerSec,
|
|
|
|
serverValue, shareValue,
|
|
|
|
)
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
2024-08-10 18:02:07 +00:00
|
|
|
c.writeRequestsTransmittedViaSMBDirectTotal,
|
2024-05-11 16:06:03 +00:00
|
|
|
prometheus.CounterValue,
|
|
|
|
instance.WriteRequestsTransmittedViaSMBDirectPerSec,
|
|
|
|
serverValue, shareValue,
|
|
|
|
)
|
|
|
|
|
|
|
|
ch <- prometheus.MustNewConstMetric(
|
2024-08-10 18:02:07 +00:00
|
|
|
c.writesTotal,
|
2024-05-11 16:06:03 +00:00
|
|
|
prometheus.CounterValue,
|
|
|
|
instance.WriteRequestsPerSec,
|
|
|
|
serverValue, shareValue,
|
|
|
|
)
|
|
|
|
}
|
2024-09-10 22:34:10 +00:00
|
|
|
|
2024-05-11 16:06:03 +00:00
|
|
|
return nil
|
|
|
|
}
|