mirror of https://github.com/hyperledger/besu
An enterprise-grade Java-based, Apache 2.0 licensed Ethereum client https://wiki.hyperledger.org/display/besu
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
113 lines
4.8 KiB
113 lines
4.8 KiB
6 years ago
|
description: Frequently asked questions FAQ and answers for troubleshooting Pantheon use
|
||
|
<!--- END of page meta data -->
|
||
|
|
||
6 years ago
|
# Monitoring Pantheon
|
||
6 years ago
|
|
||
6 years ago
|
## Monitor Node Performance and Connectivity Using the JSON-RPC API
|
||
6 years ago
|
|
||
6 years ago
|
You can monitor node performance using the [`debug_metrics`](../Reference/Pantheon-API-Methods.md#debug_metrics)
|
||
6 years ago
|
JSON-RPC API method.
|
||
|
|
||
6 years ago
|
## Monitor Node Performance Using Prometheus
|
||
6 years ago
|
|
||
|
Use the [`--metrics-enabled` option](../Reference/Pantheon-CLI-Syntax.md#metrics-enabled) to enable the [Prometheus](https://prometheus.io/) monitoring and
|
||
|
alerting service to access Pantheon metrics. You can also visualize the collected data using [Grafana](https://grafana.com/).
|
||
6 years ago
|
A sample [Pantheon Grafana dashboard](https://grafana.com/dashboards/10273) is provided.
|
||
6 years ago
|
|
||
6 years ago
|
To specify the host and port on which Prometheus accesses Pantheon, use the [`--metrics-host`](../Reference/Pantheon-CLI-Syntax.md#metrics-host) and
|
||
|
[`--metrics-port`](../Reference/Pantheon-CLI-Syntax.md#metrics-port) options.
|
||
|
The default host and port are 127.0.0.1 and 9545.
|
||
6 years ago
|
|
||
|
You can install other Prometheus components such as the Alert Manager. Additional configuration
|
||
|
is not required for these components because Prometheus handles and analyzes data directly from the feed.
|
||
|
|
||
6 years ago
|
To use Prometheus with Pantheon, install the [prometheus main component](https://prometheus.io/download/). On MacOS, install with [Homebrew](https://formulae.brew.sh/formula/prometheus):
|
||
6 years ago
|
|
||
|
```
|
||
6 years ago
|
brew install prometheus
|
||
|
```
|
||
|
|
||
|
### Setting up and Running Prometheus with Pantheon
|
||
6 years ago
|
|
||
6 years ago
|
To configure Prometheus and run with Pantheon:
|
||
|
|
||
|
1. Configure Prometheus to poll Pantheon. For example, add the following yaml fragment to the `scrape_configs`
|
||
6 years ago
|
block of the `prometheus.yml` file:
|
||
|
|
||
|
```yml tab="Example"
|
||
|
job_name: pantheon-dev
|
||
|
scrape_interval: 15s
|
||
|
scrape_timeout: 10s
|
||
|
metrics_path: /metrics
|
||
|
scheme: http
|
||
|
static_configs:
|
||
|
- targets:
|
||
|
- localhost:9545
|
||
|
```
|
||
|
|
||
6 years ago
|
1. Start Pantheon with the [`--metrics-enabled` option](../Reference/Pantheon-CLI-Syntax.md#metrics-enabled). To start
|
||
6 years ago
|
a single node for testing with metrics enabled:
|
||
|
|
||
|
```bash tab="Example"
|
||
6 years ago
|
pantheon --network=dev --miner-enabled --miner-coinbase fe3b557e8fb62b89f4916b721be55ceb828dbd73
|
||
|
--rpc-http-cors-origins="all" --rpc-http-enabled --metrics-enabled
|
||
6 years ago
|
```
|
||
|
|
||
6 years ago
|
1. In another terminal, run Prometheus specifying the `prometheus.yml` file:
|
||
6 years ago
|
|
||
|
```bash tab="Example"
|
||
|
prometheus --config.file=config.yml
|
||
|
```
|
||
|
|
||
6 years ago
|
1. Open a web browser to `http://localhost:9090` to view the Prometheus graphical interface.
|
||
6 years ago
|
|
||
6 years ago
|
1. Choose **Graph** from the menu bar and click the **Console** tab below.
|
||
6 years ago
|
|
||
6 years ago
|
1. From the **Insert metric at cursor** drop-down, select a metric such as `pantheon_blockchain_difficulty_total` or
|
||
6 years ago
|
`pantheon_blockchain_height` and click **Execute**. The values are displayed below.
|
||
|
|
||
|
Click the **Graph** tab to view the data as a time-based graph. The query string is displayed below the graph.
|
||
|
For example: `{pantheon_blockchain_height{instance="localhost:9545",job="prometheus"}`
|
||
6 years ago
|
|
||
|
### Running Prometheus with Pantheon in Push Mode
|
||
|
|
||
|
The [`--metrics-enabled`](../Reference/Pantheon-CLI-Syntax.md#metrics-enabled) option enables Prometheus polling
|
||
|
Pantheon but sometimes metrics are hard to poll (for example, when running inside Docker containers with varying IP addresses).
|
||
|
The [`--metrics-push-enabled`](../Reference/Pantheon-CLI-Syntax.md#metrics-push-enabled) option enables Pantheon
|
||
|
to push metrics to a [Prometheus Pushgateway](https://github.com/prometheus/pushgateway).
|
||
|
|
||
|
To configure Prometheus and run with Pantheon pushing to a push gateway:
|
||
|
|
||
|
1. Configure Prometheus to read from a push gateway. For example, add the following yaml fragment to the `scrape_configs`
|
||
|
block of the `prometheus.yml` file:
|
||
|
|
||
|
```yml tab="Example"
|
||
|
- job_name: push-gateway
|
||
|
metrics_path: /metrics
|
||
|
scheme: http
|
||
|
static_configs:
|
||
|
- targets:
|
||
|
- localhost:9091
|
||
|
```
|
||
6 years ago
|
|
||
6 years ago
|
1. Start the push gateway. The push gateway can be deployed using the Docker image:
|
||
|
|
||
|
```bash tab="Example"
|
||
|
docker pull prom/pushgateway
|
||
|
docker run -d -p 9091:9091 prom/pushgateway
|
||
|
```
|
||
|
|
||
|
1. Start Pantheon specifying the `--metrics-push-enabled` option and port of the push gateway:
|
||
|
|
||
|
```bash tab="Example"
|
||
|
pantheon --network=dev --miner-enabled --miner-coinbase fe3b557e8fb62b89f4916b721be55ceb828dbd73 --rpc-http-cors-origins="all" --rpc-http-enabled --metrics-push-enabled --metrics-push-port=9091 --metrics-push-host=127.0.0.1
|
||
|
```
|
||
|
|
||
|
1. In another terminal, run Prometheus specifying the `prometheus.yml` file:
|
||
|
|
||
|
```bash tab="Example"
|
||
|
prometheus --config.file=config.yml
|
||
|
```
|
||
|
|
||
|
1. View the Prometheus graphical interface as described in [Setting up and Running Prometheus with Pantheon](#setting-up-and-running-prometheus-with-pantheon).
|