func (e *RethinkdbExporter) Collect(ch chan<- prometheus.Metric) {
	start := time.Now()
	ctx := context.TODO()  
	errcount := e.collectRethinkStats(ctx, ch)
	elapsed := time.Since(start)
	ch <- prometheus.MustNewConstMetric(e.metrics.scrapeErrors, prometheus.GaugeValue, float64(errcount))
	ch <- prometheus.MustNewConstMetric(e.metrics.scrapeLatency, prometheus.GaugeValue, elapsed.Seconds())
	log.Debug().Dur("duration", elapsed).Msg("collect finished")
}
Collect send collected metrics values to the prometheus chan
package exporter
import (
	"context"
	"errors"
	"fmt"
	"time"
	"github.com/prometheus/client_golang/prometheus"
	"github.com/rs/zerolog/log"
	"golang.org/x/sync/errgroup"
	r "gopkg.in/rethinkdb/rethinkdb-go.v6"
)