Skip to content

Commit 1466cc1

Browse files
authored
metrics.rs: serve dashboard on http root as well (#57)
* metrics.rs: serve dashboard on http root as well * config.toml: Fix misleading option documentation metrics_server and remote_keypair_loader both are top-level options. However, in the example config I put it under primary_network which is wrong.
1 parent 87e4d86 commit 1466cc1

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

config/config.toml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@
33
# The address on which the websocket API server will listen on.
44
listen_address = "127.0.0.1:8910"
55

6+
# Optional top-level settings
7+
# [metrics_server]
8+
# Where to serve the quick-access dashboard and metrics. Metrics live under "/metrics"
9+
# bind_address = "127.0.0.1:8888"
10+
11+
# [remote_keypair_loader}
12+
# Where to serve the remote keypair loading endpoint, under "/primary/load_keypair" and "/secondary/load_keypair"
13+
#
14+
# NOTE: non-loopback addresses must be used carefully, making sure the
15+
# connection is not exposed for unauthorized access.
16+
# bind_address = "127.0.0.1:9001"
17+
18+
# How much whole SOL must a keypair hold to be considered valid for use on a given network. Disabled with 0
19+
# primary_min_keypair_balance_sol = 1
20+
# secondary_min_keypair_balance_sol = 1
21+
622
# Configuration for the primary network this agent will publish data to. In most cases this should be a Pythnet endpoint.
723
[primary_network]
824
### Required fields ###
@@ -105,18 +121,6 @@ key_store.root_path = "/path/to/keystore"
105121
# a value at least as large as (number of products published / number of products in a batch).
106122
# exporter.transaction_monitor.max_transactions = "100"
107123

108-
# Where to serve the quick-access dashboard and metrics.
109-
# metrics_server.bind_address = "127.0.0.1:8888"
110-
111-
# Where to serve the remote keypair loading endpoint, under "/primary/load_keypair" and "/secondary/load_keypair"
112-
#
113-
# NOTE: non-loopback addresses must be used carefully, making sure the
114-
# connection is not exposed for unauthorized access.
115-
# remote_keypair_loader.bind_address = "127.0.0.1:9001"
116-
117-
# How much whole SOL must a keypair hold to be considered valid for use on a given network. Disabled with 0
118-
# remote_keypair_loader.primary_min_keypair_balance_sol = 1
119-
# remote_keypair_loader.secondary_min_keypair_balance_sol = 1
120124

121125
# Configuration for the optional secondary network this agent will publish data to. In most cases this should be a Solana endpoint. The options correspond to the ones in primary_network
122126
# [secondary_network]

src/agent/metrics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ impl MetricsServer {
9999

100100
let shared_state4dashboard = shared_state.clone();
101101
let dashboard_route = warp::path("dashboard")
102-
.and(warp::path::end())
103-
.and_then(move || {
102+
.or(warp::path::end())
103+
.and_then(move |_| {
104104
let shared_state = shared_state4dashboard.clone();
105105
async move {
106106
let locked_state = shared_state.lock().await;

0 commit comments

Comments
 (0)