Skip to content

Commit

Permalink
refactor: adds metrics_port
Browse files Browse the repository at this point in the history
  • Loading branch information
avilagaston9 committed Jul 30, 2024
1 parent 78582e3 commit 45452a9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ checkpoint-sync: compile-all

#▶️ sepolia: @ Run an interactive terminal using sepolia network
sepolia: compile-all
iex -S mix run -- --checkpoint-sync-url https://sepolia.beaconstate.info --network sepolia --metrics
iex -S mix run -- --checkpoint-sync-url https://sepolia.beaconstate.info --network sepolia --metrics --metrics-port=2000

#▶️ holesky: @ Run an interactive terminal using holesky network
holesky: compile-all
Expand Down
9 changes: 6 additions & 3 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ switches = [
datadir: :string,
testnet_dir: :string,
metrics: :boolean,
metrics_port: :integer,
log_file: :string,
beacon_api: :boolean,
beacon_api_port: :integer,
Expand Down Expand Up @@ -42,7 +43,8 @@ checkpoint_sync_url = Keyword.get(args, :checkpoint_sync_url)
execution_endpoint = Keyword.get(args, :execution_endpoint, "http://localhost:8551")
jwt_path = Keyword.get(args, :execution_jwt)
testnet_dir = Keyword.get(args, :testnet_dir)
disable_metrics = not Keyword.get(args, :metrics, false)
enable_metrics = Keyword.get(args, :metrics, false)
metrics_port = Keyword.get(args, :metrics_port, if(enable_metrics, do: 9568, else: nil))
beacon_api_port = Keyword.get(args, :beacon_api_port, nil)
enable_beacon_api = Keyword.get(args, :beacon_api, not is_nil(beacon_api_port))
listen_addresses = Keyword.get_values(args, :listen_address)
Expand Down Expand Up @@ -187,9 +189,10 @@ block_time_ms =
# Metrics

config :lambda_ethereum_consensus, LambdaEthereumConsensus.PromEx,
disabled: disable_metrics,
disabled: not enable_metrics,
metrics_server: [
port: 9568,
port: metrics_port,
protocol: :http,
auth_strategy: :none
],
grafana: [
Expand Down
2 changes: 1 addition & 1 deletion metrics/grafana/provisioning/dashboards/home.json
Original file line number Diff line number Diff line change
Expand Up @@ -1589,7 +1589,7 @@
"uid": "PBFA97CFB590B2093"
},
"editorMode": "code",
"expr": "lambda_ethereum_consensus_prom_ex_beam_stats_uptime_milliseconds_count{job=\"prom_ex\", instance=\"host.docker.internal:9568\"}",
"expr": "lambda_ethereum_consensus_prom_ex_beam_stats_uptime_milliseconds_count{job=\"prom_ex\"}",
"legendFormat": "Uptime",
"range": true,
"refId": "Uptime"
Expand Down

0 comments on commit 45452a9

Please sign in to comment.