func ProvideGORMMetrics(in MetricsIn) *otgorm.Gauges {
	if in.Registerer == nil {
		in.Registerer = stdprometheus.DefaultRegisterer
	}
	return &otgorm.Gauges{
		Idle: newGaugeFrom(stdprometheus.GaugeOpts{
			Name: "gorm_idle_connections",
			Help: "number of idle connections",
		}, []string{"dbname", "driver"}, in.Registerer),
		Open: newGaugeFrom(stdprometheus.GaugeOpts{
			Name: "gorm_open_connections",
			Help: "number of open connections",
		}, []string{"dbname", "driver"}, in.Registerer),
		InUse: newGaugeFrom(stdprometheus.GaugeOpts{
			Name: "gorm_in_use_connections",
			Help: "number of in use connections",
		}, []string{"dbname", "driver"}, in.Registerer),
	}
}
ProvideGORMMetrics returns a *otgorm.Gauges that measures the connection info in databases.
It is meant to be consumed by the otgorm.Providers.
package observability
import (
	"github.com/DoNewsCode/core/di"
	"github.com/DoNewsCode/core/otgorm"
	"github.com/DoNewsCode/core/otkafka"
	"github.com/DoNewsCode/core/otredis"
	"github.com/DoNewsCode/core/srvgrpc"
	"github.com/DoNewsCode/core/srvhttp"
	"github.com/go-kit/kit/metrics"
	"github.com/go-kit/kit/metrics/prometheus"
	stdprometheus "github.com/prometheus/client_golang/prometheus"
)
type MetricsIn struct {
	di.In
	Registerer stdprometheus.Registerer `optional:"true"`
}
func ProvideHTTPRequestDurationSeconds(in MetricsIn) *srvhttp.RequestDurationSeconds {
	http := stdprometheus.NewHistogramVec(stdprometheus.HistogramOpts{
		Name: "http_request_duration_seconds",
		Help: "Total time spent serving requests.",
	}, []string{"module", "service", "route"})
	if in.Registerer == nil {
		in.Registerer = stdprometheus.DefaultRegisterer
	}
	in.Registerer.MustRegister(http)
	return &srvhttp.RequestDurationSeconds{
		Histogram: prometheus.NewHistogram(http),
	}
}
func ProvideGRPCRequestDurationSeconds(in MetricsIn) *srvgrpc.RequestDurationSeconds {
	grpc := stdprometheus.NewHistogramVec(stdprometheus.HistogramOpts{
		Name: "grpc_request_duration_seconds",
		Help: "Total time spent serving requests.",
	}, []string{"module", "service", "route"})
	if in.Registerer == nil {
		in.Registerer = stdprometheus.DefaultRegisterer
	}
	in.Registerer.MustRegister(grpc)
	return &srvgrpc.RequestDurationSeconds{
		Histogram: prometheus.NewHistogram(grpc),
	}
}