diff --git a/metrics/collector.go b/metrics/collector.go index d36d2bde..ab6bce09 100644 --- a/metrics/collector.go +++ b/metrics/collector.go @@ -11,7 +11,6 @@ import ( type Collector interface { ApiErrorOccurred() - TraceDownloadFailed() ServerPanicked(reason string) CadenceHeightIndexed(height uint64) EVMHeightIndexed(height uint64) @@ -26,17 +25,16 @@ var _ Collector = &DefaultCollector{} type DefaultCollector struct { // TODO: for now we cannot differentiate which api request failed number of times - apiErrorsCounter prometheus.Counter - traceDownloadErrorCounter prometheus.Counter - serverPanicsCounters *prometheus.CounterVec - cadenceBlockHeight prometheus.Gauge - evmBlockHeight prometheus.Gauge - evmBlockIndexedCounter prometheus.Counter - evmTxIndexedCounter prometheus.Counter - operatorBalance prometheus.Gauge - evmAccountCallCounters *prometheus.CounterVec - requestDurations *prometheus.HistogramVec - availableSigningkeys prometheus.Gauge + apiErrorsCounter prometheus.Counter + serverPanicsCounters *prometheus.CounterVec + cadenceBlockHeight prometheus.Gauge + evmBlockHeight prometheus.Gauge + evmBlockIndexedCounter prometheus.Counter + evmTxIndexedCounter prometheus.Counter + operatorBalance prometheus.Gauge + evmAccountCallCounters *prometheus.CounterVec + requestDurations *prometheus.HistogramVec + availableSigningkeys prometheus.Gauge } func NewCollector(logger zerolog.Logger) Collector { @@ -45,11 +43,6 @@ func NewCollector(logger zerolog.Logger) Collector { Help: "Total number of API errors", }) - traceDownloadErrorCounter := prometheus.NewCounter(prometheus.CounterOpts{ - Name: prefixedName("trace_download_errors_total"), - Help: "Total number of trace download errors", - }) - serverPanicsCounters := prometheus.NewCounterVec(prometheus.CounterOpts{ Name: prefixedName("api_server_panics_total"), Help: "Total number of panics in the API server", @@ -99,7 +92,6 @@ func NewCollector(logger zerolog.Logger) Collector { metrics := []prometheus.Collector{ apiErrors, - traceDownloadErrorCounter, serverPanicsCounters, cadenceBlockHeight, evmBlockHeight, @@ -116,17 +108,16 @@ func NewCollector(logger zerolog.Logger) Collector { } return &DefaultCollector{ - apiErrorsCounter: apiErrors, - traceDownloadErrorCounter: traceDownloadErrorCounter, - serverPanicsCounters: serverPanicsCounters, - cadenceBlockHeight: cadenceBlockHeight, - evmBlockHeight: evmBlockHeight, - evmBlockIndexedCounter: evmBlockIndexedCounter, - evmTxIndexedCounter: evmTxIndexedCounter, - evmAccountCallCounters: evmAccountCallCounters, - requestDurations: requestDurations, - operatorBalance: operatorBalance, - availableSigningkeys: availableSigningKeys, + apiErrorsCounter: apiErrors, + serverPanicsCounters: serverPanicsCounters, + cadenceBlockHeight: cadenceBlockHeight, + evmBlockHeight: evmBlockHeight, + evmBlockIndexedCounter: evmBlockIndexedCounter, + evmTxIndexedCounter: evmTxIndexedCounter, + evmAccountCallCounters: evmAccountCallCounters, + requestDurations: requestDurations, + operatorBalance: operatorBalance, + availableSigningkeys: availableSigningKeys, } } @@ -145,10 +136,6 @@ func (c *DefaultCollector) ApiErrorOccurred() { c.apiErrorsCounter.Inc() } -func (c *DefaultCollector) TraceDownloadFailed() { - c.traceDownloadErrorCounter.Inc() -} - func (c *DefaultCollector) ServerPanicked(reason string) { c.serverPanicsCounters.With(prometheus.Labels{"reason": reason}).Inc() } diff --git a/metrics/nop.go b/metrics/nop.go index c4503132..b415c143 100644 --- a/metrics/nop.go +++ b/metrics/nop.go @@ -13,7 +13,6 @@ var _ Collector = &nopCollector{} var NopCollector = &nopCollector{} func (c *nopCollector) ApiErrorOccurred() {} -func (c *nopCollector) TraceDownloadFailed() {} func (c *nopCollector) ServerPanicked(string) {} func (c *nopCollector) CadenceHeightIndexed(uint64) {} func (c *nopCollector) EVMHeightIndexed(uint64) {}