Skip to content

Prometheus metrics setup#125

Open
pablin-10 wants to merge 12 commits into
mainfrom
pablo/observability_v2
Open

Prometheus metrics setup#125
pablin-10 wants to merge 12 commits into
mainfrom
pablo/observability_v2

Conversation

@pablin-10
Copy link
Copy Markdown
Contributor

Here we add the observability features but in a separate module.

This PR aims to replace these two:

@pablin-10 pablin-10 changed the title Split observability prototype into a separate module Split observability recipes into a separate module Mar 19, 2026
Copy link
Copy Markdown
Member

@alexhulbert alexhulbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small change, otherwise lgtm

@pablin-10 pablin-10 force-pushed the pablo/observability_v2 branch from 924cb6e to 89fa85b Compare April 21, 2026 18:19
@pablin-10 pablin-10 force-pushed the pablo/observability_v2 branch 2 times, most recently from bd99350 to c0ce099 Compare April 29, 2026 23:19
@pablin-10 pablin-10 dismissed alexhulbert’s stale review April 30, 2026 03:32

Not relevant anymore

@pablin-10 pablin-10 force-pushed the pablo/observability_v2 branch from 6b2fc99 to 738717b Compare May 13, 2026 16:44
@pablin-10 pablin-10 changed the title Split observability recipes into a separate module Prometheus metrics setup May 13, 2026
@MoeMahhouk MoeMahhouk requested a review from alexhulbert May 19, 2026 09:17
Comment on lines +11 to +15
if [ -n "${METRICS_ENDPOINTS:-}" ]; then
for ip in $METRICS_ENDPOINTS; do
accept_dst_ip_port $CHAIN_ALWAYS_OUT tcp "$ip" $HTTPS_PORT "Metrics endpoint (Flashbots)"
done
fi
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is important but I have concerns about it from different angles:

  • it introduces dynamic IP allowlisting which deviates from the Flashbox L1 images having everything static and part of the measurements for attestation/verification purposes
  • should we consider dropping those opened endpoints manually for the searcher's rootless podman container as we do for couple always out endpoints in the init-container.sh? or what is the rational behind leaving that out? what's the impact if the searcher's container could reach those endpoints too beside the guest-os?
  • I recall you mentioned those IP endpoints might change, what is the process to update those and refresh the firewall rules at runtime? how invasive it is? does it have potential downtime? is it automated or manually triggered?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of curiosity, what is this used/needed for here inside the observability module itself?

--web.console.templates=/usr/share/prometheus/consoles \
--web.console.libraries=/usr/share/prometheus/console_libraries \
--web.listen-address=127.0.0.1:9090
ExecReload=/bin/kill -HUP $MAINPID
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed? doesnt systemd handle this automatically?

Comment on lines +62 to +65
if [ -z "${METRICS_FLASHBOTS_URL:-}" ]; then
echo "No metrics URL configured, remote_write disabled"
exit 0
fi
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldnt this always trigger an exit 0 here or where is "METRICS_FLASHBOTS_URL" being populated beforehand?

local key value
for key in $keys; do
value=$(echo "$secret_data" | jq -rc --arg k "$key" '.[$k] // ""')
export "${key}=${value}"
Copy link
Copy Markdown
Contributor

@Ruteri Ruteri May 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this is sanitized enough to later call source on. Can we verify this somehow?

Claude (under some pressure) gave an example payload using the fact that the export is not sanitized (using various gadgets from this PR), I think it would work in practice (nothing fancy, bare bones sh)
exploit.sh

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I'd try to avoid doing these stuff manually in bash script.
Could we do templating with minimal render engine like original did in BuilderNet using mustache (examples).

This way, the template would exactly render those values into the corresponding place-holders and avoid potential malicious attacks

@pablin-10 pablin-10 force-pushed the pablo/observability_v2 branch from 65c0e7e to 736a61c Compare May 26, 2026 14:14
@pablin-10 pablin-10 requested a review from a team as a code owner May 26, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants