Skip to content

Commit aee8317

Browse files
authored
Merge pull request #1075 from oasisprotocol/anzoman/oasis-web3-gateway-metrics
docs/node: List Oasis Web3 Gateway metrics
2 parents 792ebcc + d31a964 commit aee8317

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

docs/node/web3.mdx

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,53 @@ service] and register it in the service manager for your platform.
209209

210210
:::
211211

212+
### Metrics
213+
214+
Web3 Gateway can report a number of metrics to Prometheus server.
215+
Metrics collection is not enabled by default. Enable metrics by configuring
216+
the `monitoring` section in the config file of the Web3 gateway.
217+
218+
```yaml title='gateway.yml'
219+
...
220+
# Existing fields omitted ...
221+
gateway:
222+
# Existing fields omitted ...
223+
monitoring:
224+
host: "localhost"
225+
# Use different port for each Web3 gateway instance, if all run locally.
226+
port: 9999
227+
```
228+
229+
Oasis Web3 Gateway reports metrics starting with `oasis_web3_gateway_`.
230+
231+
The following metrics are currently reported:
232+
233+
<!-- markdownlint-disable line-length -->
234+
235+
Name | Type | Description | Labels | Package
236+
-----|------|-------------|--------|--------
237+
oasis_web3_gateway_gas_oracle_node_min_price | Gauge | Min gas price queried from the node. | | [gas](https://github.com/oasisprotocol/oasis-web3-gateway/blob/main/gas/backend.go)
238+
oasis_web3_gateway_gas_oracle_computed_price | Gauge | Computed recommended gas price based on recent full blocks. -1 if none (no recent full blocks). | | [gas](https://github.com/oasisprotocol/oasis-web3-gateway/blob/main/gas/backend.go)
239+
oasis_web3_gateway_cache_hits | Gauge | Number of cache hits. | cache | [indexer](https://github.com/oasisprotocol/oasis-web3-gateway/blob/main/indexer/backend_cache.go)
240+
oasis_web3_gateway_cache_misses | Gauge | Number of cache misses. | cache | [indexer](https://github.com/oasisprotocol/oasis-web3-gateway/blob/main/indexer/backend_cache.go)
241+
oasis_web3_gateway_cache_hit_ratio | Gauge | Percent of Hits over all accesses (Hits + Misses). | cache | [indexer](https://github.com/oasisprotocol/oasis-web3-gateway/blob/main/indexer/backend_cache.go)
242+
oasis_web3_gateway_block_indexed | Gauge | Indexed block heights. | | [indexer](https://github.com/oasisprotocol/oasis-web3-gateway/blob/main/indexer/indexer.go)
243+
oasis_web3_gateway_block_pruned | Gauge | Pruned block heights. | | [indexer](https://github.com/oasisprotocol/oasis-web3-gateway/blob/main/indexer/indexer.go)
244+
oasis_web3_gateway_indexer_health | Gauge | 1 if gateway indexer healthcheck is reporting as healthy, 0 otherwise. | | [indexer](https://github.com/oasisprotocol/oasis-web3-gateway/blob/main/indexer/indexer.go)
245+
oasis_web3_gateway_subscription_seconds | Histogram | Histogram for the eth subscription API subscriptions duration. | method_name | [rpc/eth/filters](https://github.com/oasisprotocol/oasis-web3-gateway/blob/main/rpc/eth/filters/metrics.go)
246+
oasis_web3_gateway_subscription_inflight | Gauge | Number of concurrent eth inflight subscriptions. | method_name | [rpc/eth/filters](https://github.com/oasisprotocol/oasis-web3-gateway/blob/main/rpc/eth/filters/metrics.go)
247+
oasis_web3_gateway_api_request_heights | Histogram | Histogram of eth API request heights (difference from the latest height). | method_name | [rpc/eth/metrics](https://github.com/oasisprotocol/oasis-web3-gateway/blob/main/rpc/eth/metrics/api.go)
248+
oasis_web3_gateway_signed_queries | Counter | Number of eth_call signed queries. | | [rpc/eth/metrics](https://github.com/oasisprotocol/oasis-web3-gateway/blob/main/rpc/eth/metrics/api.go)
249+
oasis_web3_gateway_api_seconds | Histogram | Histogram for the eth API requests duration. | method_name | [rpc/metrics](https://github.com/oasisprotocol/oasis-web3-gateway/blob/main/rpc/metrics/metrics.go)
250+
oasis_web3_gateway_api_request | Counter | Counter for API requests. | method_name | [rpc/metrics](https://github.com/oasisprotocol/oasis-web3-gateway/blob/main/rpc/metrics/metrics.go)
251+
oasis_web3_gateway_api_failure | Counter | Counter for API request failures. | method_name | [rpc/metrics](https://github.com/oasisprotocol/oasis-web3-gateway/blob/main/rpc/metrics/metrics.go)
252+
oasis_web3_gateway_api_success | Counter | Counter for API successful requests. | method_name | [rpc/metrics](https://github.com/oasisprotocol/oasis-web3-gateway/blob/main/rpc/metrics/metrics.go)
253+
oasis_web3_gateway_api_inflight | Gauge | Number of inflight API request. | method_name | [rpc/metrics](https://github.com/oasisprotocol/oasis-web3-gateway/blob/main/rpc/metrics/metrics.go)
254+
oasis_web3_gateway_health | Gauge | 1 if gateway healthcheck is reporting as healthy, 0 otherwise. | | [server](https://github.com/oasisprotocol/oasis-web3-gateway/blob/main/server/json_rpc.go)
255+
oasis_web3_gateway_psql_query_seconds | Histogram | Histogram for the postgresql query duration. | query | [storage/psql](https://github.com/oasisprotocol/oasis-web3-gateway/blob/main/storage/psql/metrics.go)
256+
257+
<!-- markdownlint-enable line-length -->
258+
212259
## Archive Web3 Gateway
213260

214261
Each Oasis Web3 gateway can only connect to and synchronize blocks from a

0 commit comments

Comments
 (0)