Documentation ¶
Index ¶
- Variables
- func CheckAddr(addr string) string
- func GRPCPanicInc()
- func GetAppVersion() string
- func GetFreyaVersion() string
- func GetGoVersion() string
- func GetProtoVersion() string
- func KafkaConsumerGroupMetricsF(groupName, topic string, err error, duration float64)
- func KafkaSyncProducerMetricsF(topic string, err error)
- func SetAppInfo(info *AppInfo)
- func SetApplicationMetrics()
- func StartServerWithWaiting(ctx context.Context, logger *zap.Logger, f func(errCh chan error)) error
- func WithConsulKVMetrics(requestName string, callFunc customFunc) error
- func WithCouchbaseMetrics(bucketName, collectionName, query, serviceName string, callFunc customFunc) error
- func WithElasticMetrics(requestName string, callFunc customFunc) error
- func WithHTTPMetrics(requestName string, callFunc customFunc) error
- func WithSQLMetrics(queryName, serviceName string, callFunc customFunc) error
- type AppInfo
- type Module
- type Package
- type Provider
- type Runnable
- type ServerList
- type ServerPool
- type ServiceList
- type ServicePool
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DBMetrics = promauto.NewHistogramVec( prometheus.HistogramOpts{ Namespace: "connections", Subsystem: "sql", Name: "call_duration_seconds", Help: "query duration seconds", Buckets: []float64{.005, .01, .025, .05, .075, .1, .15, .2, .25, .5, 1, 2.5}, }, []string{"query", "service", "error"}, ) DBErrorMetrics = promauto.NewCounterVec(prometheus.CounterOpts{ Namespace: "connections", Subsystem: "sql", Name: "error_total", Help: "Number of db errors.", }, []string{"query_name"}) CouchbaseMetrics = promauto.NewHistogramVec( prometheus.HistogramOpts{ Namespace: "connections", Subsystem: "couchbase", Name: "call_duration_seconds", Help: "query duration seconds", Buckets: []float64{.005, .01, .025, .05, .075, .1, .15, .2, .25, .5, 1, 2.5}, }, []string{"bucket", "collection", "query", "service", "error"}, ) HTTPMetrics = promauto.NewHistogramVec( prometheus.HistogramOpts{ Namespace: "http", Subsystem: "requests", Name: "call_duration_seconds", Help: "request duration seconds", Buckets: []float64{.005, .01, .025, .05, .075, .1, .15, .2, .25, .5, 1, 2.5}, }, []string{"request_name", "error"}, ) ElasticMetrics = promauto.NewHistogramVec( prometheus.HistogramOpts{ Namespace: "connections", Subsystem: "elastic", Name: "call_duration_seconds", Help: "request duration seconds", Buckets: []float64{.005, .01, .025, .05, .075, .1, .15, .2, .25, .5, 1, 2.5}, }, []string{"query", "error"}, ) ConsulKVMetrics = promauto.NewHistogramVec( prometheus.HistogramOpts{ Namespace: "connections", Subsystem: "consul_kv", Name: "call_duration_seconds", Help: "request duration seconds", Buckets: []float64{.005, .01, .025, .05, .075, .1, .15, .2, .25, .5, 1, 2.5}, }, []string{"query", "error"}, ) GRPCPanicMetrics = promauto.NewCounter(prometheus.CounterOpts{ Namespace: "grpc", Name: "panic_total", Help: "Number of grpc panic.", }) KafkaConsumerGroupMetrics = promauto.NewHistogramVec( prometheus.HistogramOpts{ Namespace: "kafka", Subsystem: "consumer_group", Name: "duration_consume", Help: "Consumer group consume duration", }, []string{"consumer_group", "topic", "error"}, ) KafkaSyncProducerMetrics = promauto.NewCounterVec( prometheus.CounterOpts{ Namespace: "kafka", Subsystem: "sync_producer", Name: "produce_count", Help: "Sync producer produce count", }, []string{"topic", "error"}, ) GaugeAppState = promauto.NewGaugeVec( prometheus.GaugeOpts{ Namespace: "application", Subsystem: "app", Name: "state", Help: "Versions and env of application", }, []string{ "app_version", "go_version", "proto_version", "freya_version", "start_date", }, ) ServerGRPCMetrics = grpcprom.NewServerMetrics( grpcprom.WithServerHandlingTimeHistogram(), ) )
Functions ¶
func GRPCPanicInc ¶
func GRPCPanicInc()
func GetAppVersion ¶ added in v1.0.23
func GetAppVersion() string
func GetFreyaVersion ¶ added in v1.0.23
func GetFreyaVersion() string
func GetGoVersion ¶ added in v1.0.23
func GetGoVersion() string
func GetProtoVersion ¶ added in v1.0.23
func GetProtoVersion() string
func KafkaConsumerGroupMetricsF ¶ added in v1.0.9
func KafkaSyncProducerMetricsF ¶ added in v1.0.9
func SetAppInfo ¶ added in v1.0.23
func SetAppInfo(info *AppInfo)
func SetApplicationMetrics ¶ added in v1.0.21
func SetApplicationMetrics()
func StartServerWithWaiting ¶
func WithConsulKVMetrics ¶ added in v1.1.0
func WithCouchbaseMetrics ¶ added in v1.0.23
func WithElasticMetrics ¶ added in v1.0.23
func WithHTTPMetrics ¶ added in v1.0.23
func WithSQLMetrics ¶
Types ¶
type AppInfo ¶ added in v1.0.23
type Provider ¶
type Provider struct { CreateFunc any Options []dig.ProvideOption }
type ServerList ¶
type ServerList []Runnable
type ServerPool ¶
type ServerPool struct {
// contains filtered or unexported fields
}
func NewServerPool ¶
func NewServerPool(sl ServerList, logger *zap.Logger) *ServerPool
func (*ServerPool) Stop ¶
func (p *ServerPool) Stop(ctx context.Context)
type ServiceList ¶
type ServiceList []Runnable
type ServicePool ¶
type ServicePool struct {
// contains filtered or unexported fields
}
func NewServicePool ¶
func NewServicePool(sl ServiceList, logger *zap.Logger) *ServicePool
func (*ServicePool) Stop ¶
func (p *ServicePool) Stop(ctx context.Context)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.