-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tooling): Add Ethereum Metrics Exporter (#331)
Adds support for https://github.com/ethpandaops/ethereum-metrics-exporter. An instance for every participant is spun up as EME only supports a single EL/CL pair. Can be enabled on a global or participant level. Resolves #305
- Loading branch information
Showing
11 changed files
with
3,766 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/ethereum_metrics_exporter/ethereum_metrics_exporter_context.star
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
def new_ethereum_metrics_exporter_context( | ||
pair_name, | ||
ip_addr, | ||
metrics_port_num, | ||
cl_name, | ||
el_name, | ||
): | ||
return struct( | ||
pair_name=pair_name, | ||
ip_addr=ip_addr, | ||
metrics_port_num=metrics_port_num, | ||
cl_name=cl_name, | ||
el_name=el_name, | ||
) |
54 changes: 54 additions & 0 deletions
54
src/ethereum_metrics_exporter/ethereum_metrics_exporter_launcher.star
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
shared_utils = import_module("../shared_utils/shared_utils.star") | ||
constants = import_module("../package_io/constants.star") | ||
static_files = import_module("../static_files/static_files.star") | ||
ethereum_metrics_exporter_context = import_module( | ||
"../ethereum_metrics_exporter/ethereum_metrics_exporter_context.star" | ||
) | ||
|
||
HTTP_PORT_ID = "http" | ||
METRICS_PORT_NUMBER = 9090 | ||
|
||
|
||
def launch( | ||
plan, | ||
pair_name, | ||
ethereum_metrics_exporter_service_name, | ||
ethereum_metrics_exporter_image, | ||
el_client_context, | ||
cl_client_context, | ||
): | ||
exporter_service = plan.add_service( | ||
ethereum_metrics_exporter_service_name, | ||
ServiceConfig( | ||
image=ethereum_metrics_exporter_image, | ||
ports={ | ||
HTTP_PORT_ID: shared_utils.new_port_spec( | ||
METRICS_PORT_NUMBER, | ||
shared_utils.TCP_PROTOCOL, | ||
shared_utils.HTTP_APPLICATION_PROTOCOL, | ||
) | ||
}, | ||
cmd=[ | ||
"--metrics-port", | ||
str(METRICS_PORT_NUMBER), | ||
"--consensus-url", | ||
"http://{}:{}".format( | ||
cl_client_context.ip_addr, | ||
cl_client_context.http_port_num, | ||
), | ||
"--execution-url", | ||
"http://{}:{}".format( | ||
el_client_context.ip_addr, | ||
el_client_context.rpc_port_num, | ||
), | ||
], | ||
), | ||
) | ||
|
||
return ethereum_metrics_exporter_context.new_ethereum_metrics_exporter_context( | ||
pair_name, | ||
exporter_service.ip_address, | ||
METRICS_PORT_NUMBER, | ||
cl_client_context.client_name, | ||
el_client_context.client_name, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.