Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ ethereum_metrics_exporter_context = import_module(
HTTP_PORT_ID = "http"
METRICS_PORT_NUMBER = 9090

path_to_el_db = "/data/execution-db"
path_to_cl_db = "/data/consensus-db"

DEFAULT_ETHEREUM_METRICS_EXPORTER_IMAGE = "ethpandaops/ethereum-metrics-exporter:latest"

# The min/max CPU/memory that ethereum-metrics-exporter can use
Expand All @@ -25,14 +28,41 @@ def launch(
port_publisher,
global_other_index,
docker_cache_params,
persistent,
):
public_ports = shared_utils.get_other_public_port(
port_publisher,
HTTP_PORT_ID,
global_other_index,
0,
)
files = {}
cmd = [
"--metrics-port",
str(METRICS_PORT_NUMBER),
"--consensus-url",
"{0}".format(
cl_context.beacon_http_url,
),
"--execution-url",
"http://{}:{}".format(
el_context.ip_addr,
el_context.rpc_port_num,
),
]

if persistent:
cmd.append("--monitored-directories")
cmd.append(path_to_cl_db)
cmd.append("--monitored-directories")
cmd.append(path_to_el_db)

files[path_to_el_db] = Directory(
persistent_key="data-{0}".format(el_context.service_name),
)
files[path_to_cl_db] = Directory(
persistent_key="data-{0}".format(cl_context.beacon_service_name),
)
exporter_service = plan.add_service(
ethereum_metrics_exporter_service_name,
ServiceConfig(
Expand All @@ -48,19 +78,8 @@ def launch(
)
},
public_ports=public_ports,
cmd=[
"--metrics-port",
str(METRICS_PORT_NUMBER),
"--consensus-url",
"{0}".format(
cl_context.beacon_http_url,
),
"--execution-url",
"http://{}:{}".format(
el_context.ip_addr,
el_context.rpc_port_num,
),
],
cmd=cmd,
files=files,
min_cpu=MIN_CPU,
max_cpu=MAX_CPU,
min_memory=MIN_MEMORY,
Expand Down
1 change: 1 addition & 0 deletions src/participant_network.star
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def launch_participant_network(
args_with_right_defaults.port_publisher,
global_other_index,
args_with_right_defaults.docker_cache_params,
persistent,
)
global_other_index += 1
plan.print(
Expand Down
Loading