Use metrics to monitor performance
Use the --metrics-enabled
option to enable
the Prometheus monitoring and alerting service to access EthSigner.
Install Prometheus
To use Prometheus with EthSigner, install the Prometheus main component. On MacOS, install with Homebrew:
brew install prometheus
Setting up and running Prometheus with EthSigner
To configure Prometheus to run with EthSigner:
-
Configure Prometheus to poll EthSigner. For example, add the following YAML fragment to the the
prometheus.yml
file:Example configuration
global: scrape_interval: 15s scrape_configs: - job_name: "prometheus" static_configs: - targets: ["localhost:9090"] - job_name: "ethsigner-prod" scrape_timeout: 10s metrics_path: /metrics scheme: http static_configs: - targets: ["localhost:8546"]
Note
Alternatively create your own YAML file and add the above example configuration.
-
Start EthSigner with the
--metrics-enabled
option.ethsigner --chain-id=2018 \ --downstream-http-port=8590 --metrics-enabled=true \ file-based-signer --key-file=/Users/me/signer/keyFile --password-file=/Users/me/signer/passwordFile
The
JVM
, andPROCESS
metrics categories are enabled by default. Use the--metrics-category
command line option to update the available categories.Tip
To view the full list of available EthSigner metrics view
http://<metrics-host>:<metrics-port>/metrics
. By default this ishttp://localhost:8546/metrics
. -
In another terminal, run Prometheus specifying the
prometheus.yml
file:prometheus --config.file=prometheus.yml
-
View the Prometheus graphical interface.
View Prometheus graphical interface
-
Open a web browser to
http://localhost:9090
to view the Prometheus graphical interface. -
Choose Graph from the menu bar and click the Console tab below.
-
From the Insert metric at cursor drop-down, select a metric and click Execute. The values display.