Commit 6c02dfee authored by Barnabas Busa's avatar Barnabas Busa Committed by GitHub

feat: add customizable configuraiton for prometheus retention (#745)

parent 8109054e
...@@ -639,6 +639,8 @@ def run(plan, args={}): ...@@ -639,6 +639,8 @@ def run(plan, args={}):
all_ethereum_metrics_exporter_contexts, all_ethereum_metrics_exporter_contexts,
all_xatu_sentry_contexts, all_xatu_sentry_contexts,
global_node_selectors, global_node_selectors,
args_with_right_defaults.prometheus_params.storage_tsdb_retention_time,
args_with_right_defaults.prometheus_params.storage_tsdb_retention_size,
) )
plan.print("Launching grafana...") plan.print("Launching grafana...")
......
...@@ -101,6 +101,7 @@ def input_parser(plan, input_args): ...@@ -101,6 +101,7 @@ def input_parser(plan, input_args):
result["disable_peer_scoring"] = False result["disable_peer_scoring"] = False
result["goomy_blob_params"] = get_default_goomy_blob_params() result["goomy_blob_params"] = get_default_goomy_blob_params()
result["assertoor_params"] = get_default_assertoor_params() result["assertoor_params"] = get_default_assertoor_params()
result["prometheus_params"] = get_default_prometheus_params()
result["xatu_sentry_params"] = get_default_xatu_sentry_params() result["xatu_sentry_params"] = get_default_xatu_sentry_params()
result["persistent"] = False result["persistent"] = False
result["parallel_keystore_generation"] = False result["parallel_keystore_generation"] = False
...@@ -322,6 +323,14 @@ def input_parser(plan, input_args): ...@@ -322,6 +323,14 @@ def input_parser(plan, input_args):
goomy_blob_params=struct( goomy_blob_params=struct(
goomy_blob_args=result["goomy_blob_params"]["goomy_blob_args"], goomy_blob_args=result["goomy_blob_params"]["goomy_blob_args"],
), ),
prometheus_params=struct(
storage_tsdb_retention_time=result["prometheus_params"][
"storage_tsdb_retention_time"
],
storage_tsdb_retention_size=result["prometheus_params"][
"storage_tsdb_retention_size"
],
),
apache_port=result["apache_port"], apache_port=result["apache_port"],
assertoor_params=struct( assertoor_params=struct(
image=result["assertoor_params"]["image"], image=result["assertoor_params"]["image"],
...@@ -922,6 +931,8 @@ def get_default_mev_params(mev_type, preset): ...@@ -922,6 +931,8 @@ def get_default_mev_params(mev_type, preset):
mev_builder_prometheus_config = { mev_builder_prometheus_config = {
"scrape_interval": "15s", "scrape_interval": "15s",
"labels": None, "labels": None,
"storage_tsdb_retention_time": "1d",
"storage_tsdb_retention_size": "512MB",
} }
if mev_type == constants.MEV_RS_MEV_TYPE: if mev_type == constants.MEV_RS_MEV_TYPE:
...@@ -979,6 +990,13 @@ def get_default_assertoor_params(): ...@@ -979,6 +990,13 @@ def get_default_assertoor_params():
} }
def get_default_prometheus_params():
return {
"storage_tsdb_retention_time": "1d",
"storage_tsdb_retention_size": "512MB",
}
def get_default_xatu_sentry_params(): def get_default_xatu_sentry_params():
return { return {
"xatu_sentry_image": "ethpandaops/xatu:latest", "xatu_sentry_image": "ethpandaops/xatu:latest",
......
...@@ -163,6 +163,10 @@ SUBCATEGORY_PARAMS = { ...@@ -163,6 +163,10 @@ SUBCATEGORY_PARAMS = {
"run_lifecycle_test", "run_lifecycle_test",
"tests", "tests",
], ],
"prometheus_params": [
"storage_tsdb_retention_time",
"storage_tsdb_retention_size",
],
"mev_params": [ "mev_params": [
"mev_relay_image", "mev_relay_image",
"mev_builder_image", "mev_builder_image",
......
...@@ -28,6 +28,8 @@ def launch_prometheus( ...@@ -28,6 +28,8 @@ def launch_prometheus(
ethereum_metrics_exporter_contexts, ethereum_metrics_exporter_contexts,
xatu_sentry_contexts, xatu_sentry_contexts,
global_node_selectors, global_node_selectors,
storage_tsdb_retention_time,
storage_tsdb_retention_size,
): ):
metrics_jobs = get_metrics_jobs( metrics_jobs = get_metrics_jobs(
el_contexts, el_contexts,
...@@ -46,6 +48,8 @@ def launch_prometheus( ...@@ -46,6 +48,8 @@ def launch_prometheus(
MIN_MEMORY, MIN_MEMORY,
MAX_MEMORY, MAX_MEMORY,
node_selectors=global_node_selectors, node_selectors=global_node_selectors,
storage_tsdb_retention_time=storage_tsdb_retention_time,
storage_tsdb_retention_size=storage_tsdb_retention_size,
) )
return prometheus_url return prometheus_url
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment