func (c *Collector) Collect(ch chan<- prometheus.Metric) {
	c.scrape(c.ctx, ch)
	ch <- c.metrics.TotalScrapes
	ch <- c.metrics.Error
	c.metrics.ScrapeErrors.Collect(ch)
}
Collect collect metrics
package metric
import (
	"context"
	"fmt"
	"sync"
	"time"
	"github.com/prometheus/client_golang/prometheus"
	"github.com/whywaita/myshoes/pkg/datastore"
	"github.com/whywaita/myshoes/pkg/logger"
)
const (
	namespace = "myshoes"
)
var (
	scrapeDurationDesc = prometheus.NewDesc(
		prometheus.BuildFQName(namespace, "", "collector_duration_seconds"),
		"Collector time duration.",
		[]string{"collector"}, nil,
	)
)
type Collector struct {
	ctx      context.Context
	metrics  Metrics
	ds       datastore.Datastore
	scrapers []Scraper
}
func NewCollector(ctx context.Context, ds datastore.Datastore) *Collector {
	return &Collector{
		ctx:      ctx,
		metrics:  NewMetrics(),
		ds:       ds,
		scrapers: NewScrapers(),
	}
}
func (c *Collector) Describe(ch chan<- *prometheus.Desc) {
	ch <- c.metrics.TotalScrapes.Desc()
	ch <- c.metrics.Error.Desc()
	c.metrics.ScrapeErrors.Describe(ch)
}