# Install Ethereum Metrics Exporter

## Ethereum Metrics Exporter

Ethereum Metrics Exporter exports queries consensus and execution client APIs and exports that data in the Prometheus metrics format. There is some overlap between the client API endpoints accessed by Ethereum Metrics Exporter and json\_exporter, but both exporters offer access to data in unique ways.

{% hint style="warning" %}
A single instance of Ethereum Metrics Exporter can be configured to query a single consensus/execution client group. Multiple instances of Ethereum Metrics Exporter are required to monitor multiple consensus/execution groups.
{% endhint %}

### Create System Account

Create a user account under which Ethereum Metrics Exporter can run.

```bash
sudo adduser --system eth-metrics --group --no-create-home
```

<figure><img src="/files/k9yXg2Hc38j0tlxEYizN" alt=""><figcaption><p>Results of <code>adduser</code> command</p></figcaption></figure>

### Install Ethereum Metrics Exporter

Download and build the Ethereum Metrics Exporter executable.

```bash
go install github.com/ethpandaops/ethereum-metrics-exporter@latest
```

<figure><img src="/files/uHykVQsQoyF6y1rpI3o6" alt=""><figcaption><p>Results of <code>go install</code> command</p></figcaption></figure>

Copy the executable to the `/usr/local/bin` directory.

```bash
sudo cp ~/go/bin/ethereum-metrics-exporter /usr/local/bin
```

### Create Supporting Directories

Create additional required directories.

```bash
sudo mkdir -p /var/local/lib/eth-metrics /etc/eth-metrics
```

### Configure Startup

Create a systemd service file to configure automatic startup of the Ethereum Metrics Exporter service for a single consensus/execution client pair.

```bash
sudo nano /etc/systemd/system/eth-metrics.service
```

Insert the following into the Ethereum Metrics Exporter systemd service file.

```
[Unit]
Description=Ethereum Metrics Exporter
Wants=network-online.target
After=network-online.target

[Service]
User=eth-metrics
Group=eth-metrics
Type=simple
Restart=always
RestartSec=5
ExecStart=/usr/local/bin/ethereum-metrics-exporter \
                --config /etc/eth-metrics/eth-metrics.yml \
                --metrics-port 9095

[Install]
WantedBy=multi-user.target
```

{% hint style="warning" %}
The default listening port for the Ethereum Metrics Exporter is 9090, which also happens to be the default listening port for Prometheus. In the service file above, the Ethereum Metrics Exporter port is re-assigned to 9095 through the `metrics port` flag.
{% endhint %}

{% hint style="info" %}
Each instance of Ethereum Metrics Exporter can only monitor a single consensus/execution client pair. If you need to monitor multiple consensus/execution client pairs using Ethereum Metrics Exporter, there are two options:

1. If each client pair is running on a separate host, it is easiest to follow the instructions above to install Ethereum Metrics Exporter on each host and configure it to query the local clients.
2. If multiple client pairs are running on the same host, or if you want to run all monitoring software from the same host, you will need to configure multiple instances of Ethereum Metrics Exporter on the same system. For each new client pair, copy the eth-metrics.service file above to a new unique name, and modify the configuration file and port specified in the `ExecStart` line to something unique across instances.
   {% endhint %}

### Notes

{% hint style="info" %}
Ethereum Metrics Exporter will listen on port 9095. This is the port from which Prometheus will query for metrics.
{% endhint %}

{% hint style="warning" %}
We have not yet configured nor started Ethereum Metrics Exporter.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.stakelocal.io/dashboard-installation/install-supporting-software/install-ethereum-metrics-exporter.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
