Skip to content

Commit

Permalink
Remove relic TraceDownloadFailed metric
Browse files Browse the repository at this point in the history
  • Loading branch information
m-Peter committed Jan 15, 2025
1 parent 1727f6d commit bc88364
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 34 deletions.
53 changes: 20 additions & 33 deletions metrics/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

type Collector interface {
ApiErrorOccurred()
TraceDownloadFailed()
ServerPanicked(reason string)
CadenceHeightIndexed(height uint64)
EVMHeightIndexed(height uint64)
Expand All @@ -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 {
Expand All @@ -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",
Expand Down Expand Up @@ -99,7 +92,6 @@ func NewCollector(logger zerolog.Logger) Collector {

metrics := []prometheus.Collector{
apiErrors,
traceDownloadErrorCounter,
serverPanicsCounters,
cadenceBlockHeight,
evmBlockHeight,
Expand All @@ -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,
}
}

Expand All @@ -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()
}
Expand Down
1 change: 0 additions & 1 deletion metrics/nop.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down

0 comments on commit bc88364

Please sign in to comment.