# Install json\_exporter

## json\_exporter

json\_exporter queries endpoints providing JSON-formatted data and converts that data into the Prometheus metrics format. It is used to query consensus and execution client JSON APIs, and to query external APIs for price and software release data.

### Create System Account

Create a user account under which json\_exporter can run.

```bash
sudo adduser --system json_exporter --group --no-create-home
```

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

### Build the json\_exporter Executable

The instructions below are for version 0.5.0. [Check for newer versions of json\_exporter](https://github.com/prometheus-community/json_exporter/releases), and adapt the instructions below.

Clone the latest release.

```bash
mkdir ~/git
cd ~/git
git clone --depth 1 --branch v0.5.0 https://github.com/prometheus-community/json_exporter.git
```

<figure><img src="/files/2rcQG4eR1OXzLOrlxCbK" alt=""><figcaption><p>Results of <code>git clone</code> command</p></figcaption></figure>

Build json\_exporter from source code.

```bash
cd json_exporter
make build
```

<figure><img src="/files/REwax2mL5oNP9WvOcswO" alt=""><figcaption><p>Results of <code>make build</code> command</p></figcaption></figure>

### Install json\_exporter

Copy the json\_exporter executable to the `/usr/local/bin` directory.

```bash
sudo cp json_exporter /usr/local/bin/
```

Check to see if `json_exporter` was installed correctly.

```bash
/usr/local/bin/json_exporter --version --help
```

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

Create a directory for the configuration file.

```bash
sudo mkdir /etc/json_exporter
```

### Configure Startup

Create a systemd service file to configure automatic startup of the json\_exporter service.

```bash
sudo nano /etc/systemd/system/json_exporter.service
```

Insert the following into the json\_exporter systemd service file.

```
[Unit]
Description=JSON Exporter

[Service]
Type=simple
Restart=always
RestartSec=5
User=json_exporter
ExecStart=/usr/local/bin/json_exporter --config.file /etc/json_exporter/json_exporter.yml

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

Save the file and exit the editor.

### Optional: Clean Up Installation Files

Remove the json\_exporter git repository.

```bash
cd
rm -rf ~/git/json_exporter
```

### Notes

{% hint style="info" %}
json\_exporter will listen on port 7979. This is the port from which Prometheus will query for metrics.
{% endhint %}

{% hint style="warning" %}
We have not yet configured nor started json\_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-json_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.
