Skip to content

Commit

Permalink
refactor: enable the metrics flag
Browse files Browse the repository at this point in the history
  • Loading branch information
avilagaston9 committed Jul 29, 2024
1 parent 632630b commit e938cf9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
15 changes: 0 additions & 15 deletions config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ config :lambda_ethereum_consensus, :fork, fork
# Configure logging
config :logger, level: :info, truncate: :infinity

config :lambda_ethereum_consensus, LambdaEthereumConsensus.Telemetry, enable: true

# Use Jason for JSON parsing in Phoenix
config :phoenix, :json_library, Jason

Expand All @@ -37,19 +35,6 @@ config :sentry,
enable_source_code_context: true,
root_source_code_paths: [File.cwd!()]

config :lambda_ethereum_consensus, LambdaEthereumConsensus.PromEx,
metrics_server: [
port: 9568,
auth_strategy: :none
],
grafana: [
host: "http://localhost:3000",
# Authenticate via Basic Auth
username: "admin",
password: "admin",
upload_dashboards_on_start: true
]

config :lambda_ethereum_consensus, :logger, [
{:handler, :sentry_handler, Sentry.LoggerHandler,
%{
Expand Down
18 changes: 15 additions & 3 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ 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 @@ -43,8 +42,7 @@ 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)
enable_metrics = Keyword.get(args, :metrics, false)
metrics_port = Keyword.get(args, :metrics_port, if(enable_metrics, do: 9568, else: nil))
disable_metrics = not Keyword.get(args, :metrics, false)
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 @@ -188,6 +186,20 @@ block_time_ms =

# Metrics

config :lambda_ethereum_consensus, LambdaEthereumConsensus.PromEx,
disabled: disable_metrics,
metrics_server: [
port: 9568,
auth_strategy: :none
],
grafana: [
host: "http://localhost:3000",
# Authenticate via Basic Auth
username: "admin",
password: "admin",
upload_dashboards_on_start: true
]

config :lambda_ethereum_consensus, LambdaEthereumConsensus.PromExPlugin,
block_processing_buckets: [0.5, 1.0, 1.5, 2, 4, 6, 8] |> Enum.map(&(&1 * block_time_ms))

Expand Down

0 comments on commit e938cf9

Please sign in to comment.