From b7e22c7e15f8ddec90484fc4d8ab048ae72d5e6b Mon Sep 17 00:00:00 2001 From: Trevor Judice <tjudice@gfx.io> Date: Mon, 3 Oct 2022 13:01:57 -0500 Subject: [PATCH] remove metric --- lib/gat/gatling/gatling.go | 1 - lib/metrics/gat.go | 15 --------------- 2 files changed, 16 deletions(-) diff --git a/lib/gat/gatling/gatling.go b/lib/gat/gatling/gatling.go index 6b357dc5..0a2f2107 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 976120e2..29ec7b99 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() - } -} -- GitLab