Skip to content

Commit

Permalink
review: use always localhost for metrics host
Browse files Browse the repository at this point in the history
  • Loading branch information
SantiagoPittella committed Dec 23, 2024
1 parent 5f6096e commit c8506a4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 3 additions & 1 deletion bin/tx-prover/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ max_retries_per_request = 1
max_req_per_sec = 5
# Interval to check the health of the workers
health_check_interval_secs = 1
# Port of the metrics server
prometheus_port = 6192
```

Then, to start the proxy service, you will need to run:
Expand Down Expand Up @@ -122,7 +124,7 @@ If Docker is not an option, Jaeger can also be set up directly on your machine o

## Metrics

The proxy includes a service that provides metrics for [Prometheus](https://prometheus.io/docs/introduction/overview/). This service is always enabled and uses the host and port defined in the configuration file. The metrics are available at the `/metrics` endpoint.
The proxy includes a service that provides metrics for [Prometheus](https://prometheus.io/docs/introduction/overview/). This service is always enabled and uses the port defined in the configuration file. The metrics are available at the `/metrics` endpoint.

To consume and display the metrics, you can use Prometheus and Grafana. The simplest way to install Prometheus and Grafana is by using Docker containers. To do so, run:

Expand Down
3 changes: 0 additions & 3 deletions bin/tx-prover/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ pub struct ProxyConfig {
pub available_workers_polling_time_ms: u64,
/// Health check interval in seconds.
pub health_check_interval_secs: u64,
/// Prometheus metrics host.
pub prometheus_host: String,
/// Prometheus metrics port.
pub prometheus_port: u16,
}
Expand All @@ -60,7 +58,6 @@ impl Default for ProxyConfig {
max_req_per_sec: 5,
available_workers_polling_time_ms: 20,
health_check_interval_secs: 1,
prometheus_host: "0.0.0.0".into(),
prometheus_port: 6192,
}
}
Expand Down
5 changes: 2 additions & 3 deletions bin/tx-prover/src/commands/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ impl StartProxy {
// Enable Prometheus metrics
let mut prometheus_service_http =
pingora::services::listening::Service::prometheus_http_service();
prometheus_service_http.add_tcp(
format!("{}:{}", proxy_config.prometheus_host, proxy_config.prometheus_port).as_str(),
);
prometheus_service_http
.add_tcp(format!("{}:{}", "127.0.0.1", proxy_config.prometheus_port).as_str());

server.add_service(prometheus_service_http);
server.add_service(health_check_service);
Expand Down

0 comments on commit c8506a4

Please sign in to comment.