Skip to content

Commit 6eb75cc

Browse files
committed
remove: prometheus modules
1 parent 394c002 commit 6eb75cc

File tree

13 files changed

+2
-312
lines changed

13 files changed

+2
-312
lines changed

.docs/config.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ Let's see what each section refers to:
4949
- [`database`](#database)
5050
- [`pruning`](#pruning)
5151
- [`logging`](#logging)
52-
- [`telemetry`](#telemetry)
5352

5453
## `chain`
5554
This section contains the details of the chain configuration regarding the Cosmos SDK.
@@ -63,7 +62,6 @@ This section contains the details of the chain configuration regarding the Cosmo
6362
Currently, we support the following modules:
6463

6564
- `pruning` to periodically prune the old database data
66-
- `telemetry` to support a telemetry service
6765

6866
## `node`
6967
This section contains the details of the node to which Juno will connect.
@@ -144,16 +142,4 @@ if you add the `"pruning"` entry to the `modules` field of the [`chain` config](
144142
|:-------------:|:---------:|:-------------------------------------------------------------------------------------------------------|:--------|
145143
| `interval` | `integer` | Number of blocks that should pass between one pruning and the other (default: prune every `10` blocks) | `100` |
146144
| `keep_every` | `integer` | Keep the state every `nth` block, even if it should have been pruned | `500` |
147-
| `keep_recent` | `integer` | Do not prune this amount of recent states | `100` |
148-
149-
## `telemetry`
150-
This section allows to configure the telemetry details of Juno. Note that this will have effect only if you add
151-
the `"telemetry"` entry to the `modules` field of the [`chain` config](#chain).
152-
153-
| Attribute | Type | Description | Example |
154-
|:---------:|:------:|:-----------------------------------------------|:--------|
155-
| `port` | `uint` | Port on which the telemetry server will listen | `8000` |
156-
157-
**Note**
158-
If the telemetry server is enabled, a new endpoint at the provided port and path `/metrics` will
159-
expose [Prometheus](https://prometheus.io/) data.
145+
| `keep_recent` | `integer` | Do not prune this amount of recent states | `100` |

cmd/start/cmd.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212

1313
"github.com/forbole/juno/v5/modules"
1414
"github.com/forbole/juno/v5/parser"
15-
"github.com/forbole/juno/v5/prometheus"
1615
"github.com/forbole/juno/v5/types"
1716
cmdtypes "github.com/forbole/juno/v5/types/cmd"
1817
"github.com/forbole/juno/v5/utils"
@@ -53,12 +52,6 @@ func NewStartCmd() *cobra.Command {
5352
func startParsing(ctx *parser.Context) error {
5453
// Get the config
5554
cfg := ctx.Config.Parser
56-
prometheus.StartHeight.Add(float64(cfg.StartHeight))
57-
58-
// Start the prometheus monitoring
59-
if ctx.Prometheus != nil {
60-
ctx.Prometheus.Start()
61-
}
6255

6356
// Start periodic operations
6457
scheduler := gocron.NewScheduler(time.UTC)
@@ -130,7 +123,6 @@ func enqueueMissingBlocks(exportQueue types.HeightQueue, ctx *parser.Context) {
130123
lastDBBlockHeight, err := ctx.Database.GetLastBlockHeight()
131124
if err != nil {
132125
ctx.Logger.Error("failed to get last block height from database", "error", err)
133-
prometheus.SignalDBOperationError()
134126
}
135127

136128
// Get the start height, default to the config's height
@@ -203,8 +195,6 @@ func mustGetLatestHeight(ctx *parser.Context) int64 {
203195
}
204196

205197
ctx.Logger.Error("failed to get last block from rpc client", "err", err, "retry count", retryCount)
206-
prometheus.SignalRPCRequestError()
207-
208198
time.Sleep(ctx.Config.GetAvgBlockTime() * time.Duration(retryCount))
209199
}
210200

@@ -225,8 +215,5 @@ func trapSignal(ctx *parser.Context) {
225215
defer ctx.Node.Stop()
226216
defer ctx.Database.Close()
227217
defer waitGroup.Done()
228-
if ctx.Prometheus != nil {
229-
defer ctx.Prometheus.Stop()
230-
}
231218
}()
232219
}

go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ require (
1717
github.com/gogo/protobuf v1.3.2
1818
github.com/golang/protobuf v1.5.4
1919
github.com/golangci/golangci-lint v1.52.2
20-
github.com/gorilla/mux v1.8.1
2120
github.com/grpc-ecosystem/grpc-gateway v1.16.0
2221
github.com/jmoiron/sqlx v1.3.5
2322
github.com/lib/pq v1.10.9
24-
github.com/prometheus/client_golang v1.19.0
2523
github.com/rs/zerolog v1.32.0
2624
github.com/spf13/cobra v1.8.0
2725
github.com/spf13/viper v1.18.2
@@ -169,6 +167,7 @@ require (
169167
github.com/pkg/errors v0.9.1 // indirect
170168
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
171169
github.com/polyfloyd/go-errorlint v1.4.5 // indirect
170+
github.com/prometheus/client_golang v1.19.0 // indirect
172171
github.com/prometheus/client_model v0.6.1 // indirect
173172
github.com/prometheus/common v0.52.2 // indirect
174173
github.com/prometheus/procfs v0.13.0 // indirect

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,6 @@ github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+
339339
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
340340
github.com/gordonklaus/ineffassign v0.0.0-20230107090616-13ace0543b28 h1:9alfqbrhuD+9fLZ4iaAVwhlp5PEhmnBt7yvK2Oy5C1U=
341341
github.com/gordonklaus/ineffassign v0.0.0-20230107090616-13ace0543b28/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0=
342-
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
343-
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
344342
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
345343
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
346344
github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk=

logging/default.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"github.com/rs/zerolog/log"
1010

1111
sdk "github.com/forbole/juno/v5/cosmos-sdk/types"
12-
"github.com/forbole/juno/v5/prometheus"
1312

1413
"github.com/forbole/juno/v5/modules"
1514
"github.com/forbole/juno/v5/types"
@@ -75,7 +74,6 @@ func (d *defaultLogger) Info(msg string, keyVals ...interface{}) {
7574

7675
// Error implements Logger
7776
func (d *defaultLogger) Error(msg string, keyVals ...interface{}) {
78-
prometheus.ErrorsCount.Inc()
7977
d.Logger.Error().Fields(getLogFields(keyVals...)).Msg(msg)
8078
}
8179

modules/registrar/registrar.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"github.com/forbole/juno/v5/logging"
66
"github.com/forbole/juno/v5/modules"
77
"github.com/forbole/juno/v5/modules/pruning"
8-
"github.com/forbole/juno/v5/modules/telemetry"
98
"github.com/forbole/juno/v5/node"
109
"github.com/forbole/juno/v5/types"
1110
"github.com/forbole/juno/v5/types/config"
@@ -79,7 +78,6 @@ func NewDefaultRegistrar() *DefaultRegistrar {
7978
func (r *DefaultRegistrar) BuildModules(ctx Context) modules.Modules {
8079
return modules.Modules{
8180
pruning.NewModule(ctx.JunoConfig, ctx.Database, ctx.Logger),
82-
telemetry.NewModule(ctx.JunoConfig),
8381
}
8482
}
8583

modules/telemetry/config.go

Lines changed: 0 additions & 25 deletions
This file was deleted.

modules/telemetry/handle_additional_operations.go

Lines changed: 0 additions & 50 deletions
This file was deleted.

modules/telemetry/module.go

Lines changed: 0 additions & 47 deletions
This file was deleted.

parser/context.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"github.com/forbole/juno/v5/logging"
66
"github.com/forbole/juno/v5/modules"
77
"github.com/forbole/juno/v5/node"
8-
"github.com/forbole/juno/v5/prometheus"
98
"github.com/forbole/juno/v5/types"
109
"github.com/forbole/juno/v5/types/config"
1110
)
@@ -18,7 +17,6 @@ type Context struct {
1817
Database database.Database
1918
Logger logging.Logger
2019
Modules []modules.Module
21-
Prometheus *prometheus.Server
2220
}
2321

2422
// NewContext builds a new Context instance
@@ -37,6 +35,5 @@ func NewContext(
3735
Database: db,
3836
Modules: modules,
3937
Logger: logger,
40-
Prometheus: prometheus.NewServer(config.Monitoring),
4138
}
4239
}

0 commit comments

Comments
 (0)