diff --git a/lib/gat/gatling/gatling.go b/lib/gat/gatling/gatling.go index 6b357dc5b3a14d086b451e95c56b194791bd03f2..0a2f2107a07e1cf26435f251008f94a6f6d9fd0a 100644 --- a/lib/gat/gatling/gatling.go +++ b/lib/gat/gatling/gatling.go @@ -184,7 +184,6 @@ func (g *Gatling) handleConnection(ctx context.Context, c net.Conn) { err := cl.Accept(ctx) if err != nil { - metrics.RecordConnectionError(err) if !errors.Is(err, io.EOF) { log.Println("err in connection:", err.Error()) _ = cl.Send(pg_error.IntoPacket(err)) diff --git a/lib/metrics/gat.go b/lib/metrics/gat.go index 976120e20fde241b4ad2612ba78a5c6c3eb3c936..29ec7b9980d83979316c2df9f0ad0171e05bfef3 100644 --- a/lib/metrics/gat.go +++ b/lib/metrics/gat.go @@ -28,10 +28,6 @@ func newGatmetrics() *gatMetrics { Name: "pggat_connection_count_total", Help: "total number of connections initiated with pggat", }), - ConnectionErrorCounter: promauto.NewCounterVec(prometheus.CounterOpts{ - Name: "pggat_connection_error_count_total", - Help: "total number of connections initiated with pggat", - }, []string{"error"}), ActiveConnections: promauto.NewGauge(prometheus.GaugeOpts{ Name: "pggat_current_connection_count", Help: "number of connections to pggat currently", @@ -60,14 +56,3 @@ func RecordActiveConnections(change int) { g := GatMetrics() g.ActiveConnections.Add(float64(change)) } - -func RecordConnectionError(err error) { - if !On() { - return - } - log.Println(err.Error()) - if err != nil { - g := GatMetrics() - g.ConnectionErrorCounter.WithLabelValues(err.Error()).Inc() - } -}