Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated and polished the "Torii Endpoints" topic #464

Merged
merged 5 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 25 additions & 20 deletions src/guide/advanced/metrics.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,39 @@
# Metrics

To conveniently and thoroughly monitor the performance of the network, we
recommend using [`prometheus`](https://prometheus.io/). Prometheus is a
program that can monitor your Iroha peer over a separate socket and provide
different kinds of performance metrics.
To conveniently and thoroughly monitor the performance of your instance of the Iroha network, we recommend using [`Prometheus`](https://prometheus.io/). Prometheus is a program that can monitor your Iroha peer over a separate socket and provide different kinds of performance metrics.

This data can help you find performance bottlenecks and optimise your Iroha
configuration.
This data can help you find performance bottlenecks and optimise your Iroha configuration.

#### `/metrics` Endpoint

See [Reference > Torii Endpoints: Metrics](../../reference/torii-endpoints.md#metrics).

## How to use metrics

To use metrics, you need to configure the `/metrics` endpoint in the
[Iroha configuration](https://github.com/hyperledger/iroha/blob/iroha2-dev/docs/source/references/config.md).
By default, the endpoint is exposed at `127.0.0.1:8180/metrics`. If the
port is not available, Iroha will still start and work normally, but
metrics won't be accessible.
<!-- TODO: Update this subtopic as part of PR #397: https://github.com/hyperledger/iroha-2-docs/pull/397 -->

Work in Progress.

This topic will be updated as part of the new configuration reference.

The progress on the configuration reference can be tracked in the following GitHub issue:\
[iroha-2-docs > Issue #392: Tracking issue for Configuration Reference as per RFC](https://github.com/hyperledger/iroha-2-docs/issues/392).

::: note

After that, use the IP address to access the data from the running Iroha
instance. For example:
For examples, see [Sample Configuration Files](../configure/sample-configuration.md).

:::

After the above is configured, you can use the IP address set in the `"TORII_TELEMETRY_URL"` variable to access the metrics data from within a running Iroha instance.

**Example**:

```bash
$ curl http://127.0.0.1:8080/metrics
$ curl http://127.0.0.1:8180/metrics
```

This will give you a result like this:
This returns a result similar to the following:

```bash
# HELP blocks_height Total number of blocks in chain
Expand All @@ -42,8 +52,3 @@ total_number_of_transactions 216499
# TYPE number_of_signatures_in_last_block gauge
number_of_signatures_in_last_block 5
```

## `/metrics` endpoint

Refer to the
[API specification](https://github.com/hyperledger/iroha/blob/iroha2-dev/docs/source/references/api_spec.md#metrics).
4 changes: 2 additions & 2 deletions src/guide/advanced/running-iroha-on-bare-metal.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ You can always check
[peer configuration options](/guide/configure/peer-configuration.md) for
more details.

The complete list of options is available in the
[Iroha Configuration Reference](https://github.com/hyperledger/iroha/blob/iroha2-dev/docs/source/references/config.md).
<!-- TODO: Add the new configuration reference, once its ready. Issue: https://github.com/hyperledger/iroha-2-docs/issues/392
The full list of available options is in the [Iroha Configuration Reference](https://github.com/hyperledger/iroha/blob/iroha2-dev/docs/source/references/config.md). -->

:::

Expand Down
8 changes: 4 additions & 4 deletions src/guide/configure/configuration-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ double `Option<Option<..>>`.

In this section we explain the difference between `Option<..>` and
`Option<Option<..>>` used for configuration types. You can find more about
available configuration options in
[peer configuration](peer-configuration.md). The full list of available
options is in
[Iroha Configuration Reference](https://github.com/hyperledger/iroha/blob/iroha2-dev/docs/source/references/config.md).
available configuration options in the [Peer Configuration](peer-configuration.md) topic.

<!-- TODO: Add the new configuration reference, once its ready. Issue: https://github.com/hyperledger/iroha-2-docs/issues/392
The full list of available options is in the [Iroha Configuration Reference](https://github.com/hyperledger/iroha/blob/iroha2-dev/docs/source/references/config.md). -->

## `Option<..>`

Expand Down
18 changes: 8 additions & 10 deletions src/guide/configure/peer-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ following:
- [Public and private keys for the genesis account](#genesis)
(`ACCOUNT_PUBLIC_KEY` and `ACCOUNT_PRIVATE_KEY`)

For the full list of configuration options, refer to
[Iroha Configuration Reference](https://github.com/hyperledger/iroha/blob/iroha2-dev/docs/source/references/config.md).
<!-- TODO: Add the new configuration reference, once its ready. Issue: https://github.com/hyperledger/iroha-2-docs/issues/392
The full list of available options is in the [Iroha Configuration Reference](https://github.com/hyperledger/iroha/blob/iroha2-dev/docs/source/references/config.md). -->

::: info

Expand Down Expand Up @@ -88,10 +88,8 @@ trusted peers:
`TORII` is the module in charge of handling incoming and outgoing
connections.

Here we only cover the required configurations: `API_URL`, `P2P_ADDR`, and
`TELEMETRY_URL`. Check
[`TORII` configuration reference](https://github.com/hyperledger/iroha/blob/iroha2-dev/docs/source/references/config.md#torii)
for all available options.
<!-- TODO: Add the new configuration reference, once its ready. Issue: https://github.com/hyperledger/iroha-2-docs/issues/392
The full list of available options is in the [Iroha Configuration Reference](https://github.com/hyperledger/iroha/blob/iroha2-dev/docs/source/references/config.md). -->

### `API_URL`

Expand Down Expand Up @@ -153,8 +151,8 @@ configurations, such as:
- `GENESIS_SUBMISSION_DELAY_MS`: the delay before the genesis block
submission after the minimum number of peers were discovered.

You can find more details in
[`GENESIS` Iroha Configuration Reference](https://github.com/hyperledger/iroha/blob/iroha2-dev/docs/source/references/config.md#genesis).
<!-- TODO: Add the new configuration reference, once its ready. Issue: https://github.com/hyperledger/iroha-2-docs/issues/392
The full list of available options is in the [Iroha Configuration Reference](https://github.com/hyperledger/iroha/blob/iroha2-dev/docs/source/references/config.md). -->

## Logger

Expand Down Expand Up @@ -202,5 +200,5 @@ _warehouse_). The `BLOCK_STORE_PATH` specifies where the blocks are stored.
You can change it to a custom location if for some reason the default
location (`./storage`) is not available or desirable.

For more details, check
[`KURA` configuration reference](https://github.com/hyperledger/iroha/blob/iroha2-dev/docs/source/references/config.md#kura).
<!-- TODO: Add the new configuration reference, once its ready. Issue: https://github.com/hyperledger/iroha-2-docs/issues/392
The full list of available options is in the [Iroha Configuration Reference](https://github.com/hyperledger/iroha/blob/iroha2-dev/docs/source/references/config.md). -->
10 changes: 6 additions & 4 deletions src/guide/configure/sample-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

Here you can find sample configuration files for Iroha 2:

- Peer Configuration (`configs/peer/config.json`). Refer to [peer configuration](peer-configuration.md) for details.
- Genesis Block (`configs/peer/genesis.json`). Refer to [genesis block](genesis.md) for details.
- Client Configuration (`configs/client_cli/config.json`). Refer to [client configuration](client-configuration.md) for details.
- Peer Configuration [`configs/peer/config.json`](https://github.com/hyperledger/iroha/blob/iroha2-dev/configs/peer/config.json).\
For details, see [Peer Configuration](peer-configuration.md).
- Genesis Block [`configs/peer/genesis.json`](https://github.com/hyperledger/iroha/blob/iroha2-dev/configs/peer/genesis.json).\
For details, see [Genesis Block](genesis.md).
- Client Configuration [`configs/client/config.json`](https://github.com/hyperledger/iroha/blob/iroha2-dev/configs/client/config.json).\
For details, see [Client Configuration](client-configuration.md).

::: code-group

Expand All @@ -15,4 +18,3 @@ Here you can find sample configuration files for Iroha 2:
<<< @/snippets/client-cli-config.json

:::

Loading
Loading