diff --git a/.golangci.yml b/.golangci.yml index 9e1cd82ba..589b2245b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -81,3 +81,5 @@ linters-settings: - whyNoLint dogsled: max-blank-identifiers: 3 + sloglint: + attr-only: true \ No newline at end of file diff --git a/cmd/collectors/storagegrid/rest/client.go b/cmd/collectors/storagegrid/rest/client.go index dac88b0dd..f13b1f2d9 100644 --- a/cmd/collectors/storagegrid/rest/client.go +++ b/cmd/collectors/storagegrid/rest/client.go @@ -71,7 +71,7 @@ func NewClient(pollerName string, clientTimeout string, c *auth.Credentials) (*C timeout, _ = time.ParseDuration(DefaultTimeout) } if client, err = New(poller, timeout, c); err != nil { - return nil, fmt.Errorf("uanble to create poller [%s]. err: %w", pollerName, err) + return nil, fmt.Errorf("unable to create poller [%s]. err: %w", pollerName, err) } return client, err diff --git a/cmd/collectors/zapi/plugins/qospolicyadaptive/qospolicyadaptive.go b/cmd/collectors/zapi/plugins/qospolicyadaptive/qospolicyadaptive.go index 4f0b49b5e..24ca1544e 100644 --- a/cmd/collectors/zapi/plugins/qospolicyadaptive/qospolicyadaptive.go +++ b/cmd/collectors/zapi/plugins/qospolicyadaptive/qospolicyadaptive.go @@ -28,7 +28,7 @@ func (p *QosPolicyAdaptive) Run(dataMap map[string]*matrix.Matrix) ([]*matrix.Ma for _, k := range metrics { err := matrix.CreateMetric(k, data) if err != nil { - p.SLogger.Error("error while creating metric", "key", k, "err", err) + p.SLogger.Error("error while creating metric", slog.Any("err", err), slog.String("key", k)) return nil, nil, err } } diff --git a/cmd/collectors/zapiperf/plugins/disk/disk.go b/cmd/collectors/zapiperf/plugins/disk/disk.go index e190bca09..4b27d66bf 100644 --- a/cmd/collectors/zapiperf/plugins/disk/disk.go +++ b/cmd/collectors/zapiperf/plugins/disk/disk.go @@ -190,7 +190,7 @@ func (d *Disk) Init() error { d.shelfData[attribute].SetExportOptions(exportOptions) } - d.SLogger.Debug("initialized with shelfData", "objects", len(d.shelfData)) + d.SLogger.Debug("initialized with shelfData", slog.Int("objects", len(d.shelfData))) // setup batchSize for request d.batchSize = batchSize