Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MetricQueryTotal = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "pace_postgres_query_total", Help: "Collects stats about the number of postgres queries made", }, []string{"database"}, ) MetricQueryFailed = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "pace_postgres_query_failed", Help: "Collects stats about the number of postgres queries failed", }, []string{"database"}, ) MetricQueryDurationSeconds = prometheus.NewHistogramVec( prometheus.HistogramOpts{ Name: "pace_postgres_query_duration_seconds", Help: "Collect performance metrics for each postgres query", Buckets: []float64{.1, .25, .5, 1, 2.5, 5, 10, 60}, }, []string{"database"}, ) MetricQueryAffectedTotal = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "pace_postgres_query_affected_total", Help: "Collects stats about the number of rows affected by a postgres query", }, []string{"database"}, ) )
Functions ¶
This section is empty.
Types ¶
type LoggingHook ¶
type LoggingHook struct {
// contains filtered or unexported fields
}
func NewLoggingHook ¶
func NewLoggingHook(logRead bool, logWrite bool) *LoggingHook
func (*LoggingHook) AfterQuery ¶
func (h *LoggingHook) AfterQuery(ctx context.Context, event *bun.QueryEvent)
func (*LoggingHook) BeforeQuery ¶
func (h *LoggingHook) BeforeQuery(ctx context.Context, event *bun.QueryEvent) context.Context
type MetricsHook ¶
type MetricsHook struct {
// contains filtered or unexported fields
}
func NewMetricsHook ¶
func NewMetricsHook(addr string, database string) *MetricsHook
func (*MetricsHook) AfterQuery ¶
func (h *MetricsHook) AfterQuery(ctx context.Context, event *bun.QueryEvent)
func (*MetricsHook) BeforeQuery ¶
func (h *MetricsHook) BeforeQuery(ctx context.Context, event *bun.QueryEvent) context.Context
type TracingHook ¶
type TracingHook struct{}
func (*TracingHook) AfterQuery ¶
func (h *TracingHook) AfterQuery(ctx context.Context, event *bun.QueryEvent)
func (*TracingHook) BeforeQuery ¶
func (h *TracingHook) BeforeQuery(ctx context.Context, event *bun.QueryEvent) context.Context
Click to show internal directories.
Click to hide internal directories.