diff --git a/receiver/riakreceiver/client_test.go b/receiver/riakreceiver/client_test.go index b906e55dbb5a..bd06922c90b4 100644 --- a/receiver/riakreceiver/client_test.go +++ b/receiver/riakreceiver/client_test.go @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// nolint:errcheck package riakreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/riakreceiver" import ( @@ -112,7 +111,8 @@ func TestGetStatsDetails(t *testing.T) { // Setup test server ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - w.Write(data) + _, err := w.Write(data) + require.NoError(t, err) })) defer ts.Close() diff --git a/receiver/riakreceiver/scraper.go b/receiver/riakreceiver/scraper.go index f439e82eb7c7..c5d55be47ec2 100644 --- a/receiver/riakreceiver/scraper.go +++ b/receiver/riakreceiver/scraper.go @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// nolint:gocritic package riakreceiver // import "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/riakreceiver" import ( @@ -77,25 +76,25 @@ func (r *riakScraper) scrape(ctx context.Context) (pmetric.Metrics, error) { func (r *riakScraper) collectStats(stat *model.Stats) (pmetric.Metrics, error) { now := pcommon.NewTimestampFromTime(time.Now()) var errors scrapererror.ScrapeErrors - //scrape node.operation.count metric + // scrape node.operation.count metric r.mb.RecordRiakNodeOperationCountDataPoint(now, stat.NodeGets, metadata.AttributeRequestGet) r.mb.RecordRiakNodeOperationCountDataPoint(now, stat.NodePuts, metadata.AttributeRequestPut) - //scrape node.operation.time.mean metric + // scrape node.operation.time.mean metric r.mb.RecordRiakNodeOperationTimeMeanDataPoint(now, stat.NodeGetFsmTimeMean, metadata.AttributeRequestGet) r.mb.RecordRiakNodeOperationTimeMeanDataPoint(now, stat.NodePutFsmTimeMean, metadata.AttributeRequestPut) - //scrape node.read_repair.count metric + // scrape node.read_repair.count metric r.mb.RecordRiakNodeReadRepairCountDataPoint(now, stat.ReadRepairs) - //scrape node.memory.limit metric + // scrape node.memory.limit metric r.mb.RecordRiakMemoryLimitDataPoint(now, stat.MemAllocated) - //scrape vnode.operation.count metric + // scrape vnode.operation.count metric r.mb.RecordRiakVnodeOperationCountDataPoint(now, stat.VnodeGets, metadata.AttributeRequestGet) r.mb.RecordRiakVnodeOperationCountDataPoint(now, stat.VnodePuts, metadata.AttributeRequestPut) - //scrape vnode.index.operation.count metric + // scrape vnode.index.operation.count metric r.mb.RecordRiakVnodeIndexOperationCountDataPoint(now, stat.VnodeIndexReads, metadata.AttributeOperationRead) r.mb.RecordRiakVnodeIndexOperationCountDataPoint(now, stat.VnodeIndexWrites, metadata.AttributeOperationWrite) r.mb.RecordRiakVnodeIndexOperationCountDataPoint(now, stat.VnodeIndexDeletes, metadata.AttributeOperationDelete)