Skip to content

Add Prometheus metrics and Grafana dashboard#15

Merged
jsign merged 14 commits into
masterfrom
jsign-observability
Jan 2, 2026
Merged

Add Prometheus metrics and Grafana dashboard#15
jsign merged 14 commits into
masterfrom
jsign-observability

Conversation

@jsign

@jsign jsign commented Jan 1, 2026

Copy link
Copy Markdown
Contributor

Considering the zkboost-server will be a pretty important piece of infrastructure, I'm adding some Prometheus metrics, so we can easily understand what's going on, rather than just looking at logs.

Also added a Grafana dashboard for those metrics, which also spins up with docker-compose.

Example:

$ docker compose -f docker/docker-compose.yml up --build
...

Enter https://localhost:3001, login with (admin, admin):
image
(Not that interesting stuff showing half-ish of the dashboard -- prob on first real use we can check how the whole thing looks better)

Comment thread docker/Dockerfile
Comment on lines +21 to +25
# Install runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
libssl3 \
ca-certificates \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

@jsign jsign Jan 1, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In my machine, not installing usual SSL certificates was making zkboost server crash.

zkboost-1  | /app/zkboost-server: error while loading shared libraries: [libssl.so](http://libssl.so/).3: cannot open shared object file: No such file or directory

Comment on lines -29 to +33
#[derive(Clone, Default)]
#[derive(Clone)]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Default isn't used now since we have metrics. This is resolved with another helper for tests.

let state = AppState::new(&config, metrics_handle).await?;

// Record application metrics
metrics::set_programs_loaded(state.programs.read().await.len());

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Mostly trying to catch potential misconfigs in the dashboard. I think we could also go deeper and have a table in Grafana -- but we can think more about it in the near future.

&program_id.0,
true,
start.elapsed(),
report.total_num_cycles,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note entirely suer the total_num_cycles is super useful. But considering at this layer zkboost is generic (and not only for Ethereum), I think might be good.

I think we can add also metrics in teh relayer whenever that fully exists, since it is another important piece of the flow.

@jsign
jsign marked this pull request as ready for review January 1, 2026 20:48
@jsign
jsign requested a review from han0110 January 1, 2026 20:48

@han0110 han0110 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM!

Tho while trying to spin up it with docker compose, I found when using real zkVM there will be some networking problems:

  • zkboost uses ere-dockerized, which spawns a server container and use client to connect to it
  • But when zkboost is also started as a container, even given the docker socket such that it can creates server container out of docker, it couldn't connect to it unless we set network_mode: host
  • When we set network_mode: host to zkboost, the prometheus couldn't scrape the metrics, hence we need to make everything live in host network.

We'd need to figure out a better approach to make these configuration easier to do, one approach is to use ere-dockerized and make it aware we are in docker, and it shuold connect to the container name instead of localhost.

@jsign

jsign commented Jan 2, 2026

Copy link
Copy Markdown
Contributor Author

one approach is to use ere-dockerized and make it aware we are in docker, and it shuold connect to the container name instead of localhost.

Agree. So we would need to create a network in the docker-compose setup, say, zkboost-network and put all the docker compose containers into it. And in ere, create some env var like ERE_DOCKER_NETWORK and if that is set (=zkboost-network), spawn ere-dockerized server container also connected to that network and use the container name instead of localhost.

Any preferences on merging or leaving this PR open until this is fully solved? No strong opinion from my side.

@han0110

han0110 commented Jan 2, 2026

Copy link
Copy Markdown
Collaborator

Agree. So we would need to create a network in the docker-compose setup, say, zkboost-network and put all the docker compose containers into it. And in ere, create some env var like ERE_DOCKER_NETWORK and if that is set (=zkboost-network), spawn ere-dockerized server container also connected to that network and use the container name instead of localhost.

Sounds good!

Any preferences on merging or leaving this PR open until this is fully solved? No strong opinion from my side.

Ah I think we can resolve it later, feel free to merge.

@jsign
jsign merged commit e486c0e into master Jan 2, 2026
12 checks passed
@jsign
jsign deleted the jsign-observability branch January 2, 2026 13:33
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.

2 participants