Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing smbclient collector #1408

Merged
merged 17 commits into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Name | Description | Enabled by default
[scheduled_task](docs/collector.scheduled_task.md) | Scheduled Tasks metrics |
[service](docs/collector.service.md) | Service state metrics | ✓
[smb](docs/collector.smb.md) | SMB Server |
[smbclient](docs/collector.smbclient.md) | SMB Client |
[smtp](docs/collector.smtp.md) | IIS SMTP Server |
[system](docs/collector.system.md) | System calls | ✓
[tcp](docs/collector.tcp.md) | TCP connections |
Expand Down
50 changes: 50 additions & 0 deletions docs/collector.smbclient.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# smbclient collector
The smbclient collector collects metrics from MS SmbClient hosts through perflib
|||
-|-
Metric name prefix | `windows_smbclient`
Classes | [Win32_PerfRawData_SMB](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-smb/)<br/>
Enabled by default? | No

## Flags

### `--collectors.smbclient.list`
Lists the Perflib Objects that are queried for data along with the perlfib object id

### `--collectors.smbclient.enabled`
Comma-separated list of collectors to use, for example: `--collectors.smbclient.enabled=ServerShares`. Matching is case-sensitive. Depending on the smb protocol version not all performance counters may be available. Use `--collectors.smbclient.list` to obtain a list of supported collectors.

## Metrics
jkroepke marked this conversation as resolved.
Show resolved Hide resolved
Name | Description | Type | Labels
-----|-------------|------|-------
`windows_smbclient_data_queue_seconds_total` | Seconds requests waited on queue on this share | counter | `server`, `share`|
`windows_smbclient_read_queue_seconds_total` | Seconds read requests waited on queue on this share | counter | `server`, `share`|
`windows_smbclient_write_queue_seconds_total` | Seconds write requests waited on queue on this share | counter | `server`, `share`|
`windows_smbclient_request_seconds_total` | Seconds waiting for requests on this share | counter | `server`, `share`|
`windows_smbclient_stalls_total` | The number of requests delayed based on insufficient credits on this share | counter | `server`, `share`|
`windows_smbclient_requests_queued` | The point in time (current) number of requests outstanding on this share | counter | `server`, `share`|
`windows_smbclient_data_bytes_total` | The bytes read or written on this share | counter | `server`, `share`|
`windows_smbclient_requests_total` | The requests on this share | counter | `server`, `share`|
`windows_smbclient_metadata_requests_total` | The metadata requests on this share | counter | `server`, `share`|
`windows_smbclient_read_bytes_via_smbdirect_total` | The bytes read from this share via RDMA direct placement | TBD | `server`, `share`|
`windows_smbclient_read_bytes_total` | The bytes read on this share | counter | `server`, `share`|
`windows_smbclient_read_requests_via_smbdirect_total` | The read requests on this share via RDMA direct placement | TBD | `server`, `share`|
`windows_smbclient_read_requests_total` | The read requests on this share | counter | `server`, `share`|
`windows_smbclient_turbo_io_reads_total` | The read requests that go through Turbo I/O | TBD | `server`, `share`|
`windows_smbclient_turbo_io_writes_total` | The write requests that go through Turbo I/O | TBD | `server`, `share`|
`windows_smbclient_write_bytes_via_smbdirect_total` | The written bytes to this share via RDMA direct placement | TBD | `server`, `share`|
`windows_smbclient_write_bytes_total` | The bytes written on this share | counter | `server`, `share`|
`windows_smbclient_write_requests_via_smbdirect_total` | The write requests to this share via RDMA direct placement | TBD | `server`, `share`|
`windows_smbclient_write_requests_total` | The write requests on this share | counter | `server`, `share`|
`windows_smbclient_read_seconds_total` | Seconds waiting for read requests on this share | counter | `server`, `share`|
`windows_smbclient_write_seconds_total` | Seconds waiting for write requests on this share | counter | `server`, `share`|
## Useful queries
```
# Average request queue length (includes read and write).
irate(windows_smbclient_data_queue_seconds_total)
# Request latency milliseconds (includes read and write).
irate(windows_smbclient_request_seconds_total) / irate(windows_smbclient_requests_total) * 1000
```
## Alerting examples
_This collector does not yet have alerting examples, we would appreciate your help adding them!_

2 changes: 2 additions & 0 deletions pkg/collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import (
"github.com/prometheus-community/windows_exporter/pkg/collector/scheduled_task"
"github.com/prometheus-community/windows_exporter/pkg/collector/service"
"github.com/prometheus-community/windows_exporter/pkg/collector/smb"
"github.com/prometheus-community/windows_exporter/pkg/collector/smbclient"
"github.com/prometheus-community/windows_exporter/pkg/collector/smtp"
"github.com/prometheus-community/windows_exporter/pkg/collector/system"
"github.com/prometheus-community/windows_exporter/pkg/collector/tcp"
Expand Down Expand Up @@ -128,6 +129,7 @@ func NewWithConfig(logger log.Logger, config Config) Collectors {
collectors[scheduled_task.Name] = scheduled_task.New(logger, &config.ScheduledTask)
collectors[service.Name] = service.New(logger, &config.Service)
collectors[smb.Name] = smb.New(logger, &config.Smb)
collectors[smbclient.Name] = smbclient.New(logger, &config.SmbClient)
collectors[smtp.Name] = smtp.New(logger, &config.Smtp)
collectors[system.Name] = system.New(logger, &config.System)
collectors[teradici_pcoip.Name] = teradici_pcoip.New(logger, &config.TeradiciPcoip)
Expand Down
3 changes: 3 additions & 0 deletions pkg/collector/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import (
"github.com/prometheus-community/windows_exporter/pkg/collector/scheduled_task"
"github.com/prometheus-community/windows_exporter/pkg/collector/service"
"github.com/prometheus-community/windows_exporter/pkg/collector/smb"
"github.com/prometheus-community/windows_exporter/pkg/collector/smbclient"
"github.com/prometheus-community/windows_exporter/pkg/collector/smtp"
"github.com/prometheus-community/windows_exporter/pkg/collector/system"
"github.com/prometheus-community/windows_exporter/pkg/collector/tcp"
Expand Down Expand Up @@ -99,6 +100,7 @@ type Config struct {
ScheduledTask scheduled_task.Config `yaml:"scheduled_task"`
Service service.Config `yaml:"service"`
Smb smb.Config `yaml:"smb"`
SmbClient smbclient.Config `yaml:"smbclient"`
Smtp smtp.Config `yaml:"smtp"`
System system.Config `yaml:"system"`
TeradiciPcoip teradici_pcoip.Config `yaml:"teradici_pcoip"`
Expand Down Expand Up @@ -156,6 +158,7 @@ var ConfigDefaults = Config{
ScheduledTask: scheduled_task.ConfigDefaults,
Service: service.ConfigDefaults,
Smb: smb.ConfigDefaults,
SmbClient: smbclient.ConfigDefaults,
Smtp: smtp.ConfigDefaults,
System: system.ConfigDefaults,
TeradiciPcoip: teradici_pcoip.ConfigDefaults,
Expand Down
2 changes: 2 additions & 0 deletions pkg/collector/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import (
"github.com/prometheus-community/windows_exporter/pkg/collector/scheduled_task"
"github.com/prometheus-community/windows_exporter/pkg/collector/service"
"github.com/prometheus-community/windows_exporter/pkg/collector/smb"
"github.com/prometheus-community/windows_exporter/pkg/collector/smbclient"
"github.com/prometheus-community/windows_exporter/pkg/collector/smtp"
"github.com/prometheus-community/windows_exporter/pkg/collector/system"
"github.com/prometheus-community/windows_exporter/pkg/collector/tcp"
Expand Down Expand Up @@ -103,6 +104,7 @@ var Map = map[string]types.CollectorBuilderWithFlags{
scheduled_task.Name: scheduled_task.NewWithFlags,
service.Name: service.NewWithFlags,
smb.Name: smb.NewWithFlags,
smbclient.Name: smbclient.NewWithFlags,
smtp.Name: smtp.NewWithFlags,
system.Name: system.NewWithFlags,
teradici_pcoip.Name: teradici_pcoip.NewWithFlags,
Expand Down
Loading
Loading