func InitMetrics() *Metrics {
	if metrics != nil {
		return metrics
	}
	metrics = createMetrics()
	prometheus.MustRegister(
		metrics.LeaderGauge,
		metrics.ReceivedSamples,
		metrics.ReceivedMetadata,
		metrics.ReceivedQueries,
		metrics.SentSamples,
		metrics.SentMetadata,
		metrics.FailedSamples,
		metrics.FailedMetadata,
		metrics.FailedQueries,
		metrics.InvalidReadReqs,
		metrics.InvalidWriteReqs,
		metrics.SentBatchDuration,
		metrics.QueryBatchDuration,
		metrics.QueryDuration,
		metrics.ExemplarQueryDuration,
		metrics.HTTPRequestDuration,
	)
	return metrics
}
InitMetrics sets up and returns the Prometheus metrics which Promscale exposes.
This needs to be set before calling objects from the api package.
package api
import (
	"time"
	"github.com/prometheus/client_golang/prometheus"
	"github.com/timescale/promscale/pkg/util"
)
var metrics *Metrics
type Metrics struct {
	LastRequestUnixNano   int64
	LeaderGauge           prometheus.Gauge
	ReceivedSamples       prometheus.Counter
	ReceivedMetadata      prometheus.Counter
	FailedSamples         prometheus.Counter
	FailedMetadata        prometheus.Counter
	SentSamples           prometheus.Counter
	SentMetadata          prometheus.Counter
	SentBatchDuration     prometheus.Histogram
	ReceivedQueries       prometheus.Counter
	FailedQueries         prometheus.Counter
	QueryBatchDuration    prometheus.Histogram
	ExemplarQueryDuration prometheus.Histogram
	QueryDuration         prometheus.Histogram
	InvalidReadReqs       prometheus.Counter
	InvalidWriteReqs      prometheus.Counter
	InvalidQueryReqs      prometheus.Counter
	HTTPRequestDuration   *prometheus.HistogramVec
}