Skip to content

Commit

Permalink
feat: add customizable configuraiton for prometheus retention (#745)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnabasbusa authored Aug 19, 2024
1 parent 8109054 commit 6c02dfe
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,8 @@ def run(plan, args={}):
all_ethereum_metrics_exporter_contexts,
all_xatu_sentry_contexts,
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...")
Expand Down
18 changes: 18 additions & 0 deletions src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def input_parser(plan, input_args):
result["disable_peer_scoring"] = False
result["goomy_blob_params"] = get_default_goomy_blob_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["persistent"] = False
result["parallel_keystore_generation"] = False
Expand Down Expand Up @@ -322,6 +323,14 @@ def input_parser(plan, input_args):
goomy_blob_params=struct(
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"],
assertoor_params=struct(
image=result["assertoor_params"]["image"],
Expand Down Expand Up @@ -922,6 +931,8 @@ def get_default_mev_params(mev_type, preset):
mev_builder_prometheus_config = {
"scrape_interval": "15s",
"labels": None,
"storage_tsdb_retention_time": "1d",
"storage_tsdb_retention_size": "512MB",
}

if mev_type == constants.MEV_RS_MEV_TYPE:
Expand Down Expand Up @@ -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():
return {
"xatu_sentry_image": "ethpandaops/xatu:latest",
Expand Down
4 changes: 4 additions & 0 deletions src/package_io/sanity_check.star
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ SUBCATEGORY_PARAMS = {
"run_lifecycle_test",
"tests",
],
"prometheus_params": [
"storage_tsdb_retention_time",
"storage_tsdb_retention_size",
],
"mev_params": [
"mev_relay_image",
"mev_builder_image",
Expand Down
4 changes: 4 additions & 0 deletions src/prometheus/prometheus_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ def launch_prometheus(
ethereum_metrics_exporter_contexts,
xatu_sentry_contexts,
global_node_selectors,
storage_tsdb_retention_time,
storage_tsdb_retention_size,
):
metrics_jobs = get_metrics_jobs(
el_contexts,
Expand All @@ -46,6 +48,8 @@ def launch_prometheus(
MIN_MEMORY,
MAX_MEMORY,
node_selectors=global_node_selectors,
storage_tsdb_retention_time=storage_tsdb_retention_time,
storage_tsdb_retention_size=storage_tsdb_retention_size,
)

return prometheus_url
Expand Down

0 comments on commit 6c02dfe

Please sign in to comment.