docs(metrics): no metrics.expensive

Signed-off-by: 9547 <29431502+9547@users.noreply.github.com>
This commit is contained in:
9547 2024-12-13 23:06:39 +08:00
parent cbf24cb2b2
commit e40ef1aca9

View file

@ -3,7 +3,7 @@ title: Metrics
description: Introduction to reporting metrics from Geth description: Introduction to reporting metrics from Geth
--- ---
Geth includes a variety of optional metrics that can be reported to the user. However, metrics are disabled by default to save on the computational overhead for the average user. Users that choose to see more detailed metrics can enable them using the `--metrics` flag when starting Geth. Some metrics are classed as especially expensive and are only enabled when the `--metrics.expensive` flag is supplied. For example, per-packet network traffic data is considered expensive. Geth includes a variety of optional metrics that can be reported to the user. However, metrics are disabled by default to save on the computational overhead for the average user. Users that choose to see more detailed metrics can enable them using the `--metrics` flag when starting Geth.
The goal of the Geth metrics system is that - similar to logs - arbitrary metric collections can be added to any part of the code without requiring fancy constructs to analyze them (counter variables, public interfaces, crossing over the APIs, console hooks, etc). Instead, metrics should be "updated" whenever and wherever needed and be automatically collected, surfaced through the APIs, queryable and visualizable for analysis. The goal of the Geth metrics system is that - similar to logs - arbitrary metric collections can be added to any part of the code without requiring fancy constructs to analyze them (counter variables, public interfaces, crossing over the APIs, console hooks, etc). Instead, metrics should be "updated" whenever and wherever needed and be automatically collected, surfaced through the APIs, queryable and visualizable for analysis.
@ -40,10 +40,10 @@ A gauge is a single int64 value. Its value can increment and decrement - as with
## Querying metrics {#querying-metrics} ## Querying metrics {#querying-metrics}
Geth collects metrics if the `--metrics` flag is provided at startup. Those metrics are available via an HTTP server if the `--metrics.addr` flag is also provided. By default the metrics are served at `127.0.0.1:6060/debug/metrics` but a custom IP address can be provided. A custom port can also be provided to the `--metrics.port` flag. More computationally expensive metrics are toggled on or off by providing or omitting the `--metrics.expensive` flag. For example, to serve all metrics at the default address and port: Geth collects metrics if the `--metrics` flag is provided at startup. Those metrics are available via an HTTP server if the `--metrics.addr` flag is also provided. By default the metrics are served at `127.0.0.1:6060/debug/metrics` but a custom IP address can be provided. A custom port can also be provided to the `--metrics.port` flag. For example, to serve all metrics at the default address and port:
```sh ```sh
geth <other commands> --metrics --metrics.addr 127.0.0.1 --metrics.expensive geth <other commands> --metrics --metrics.addr 127.0.0.1 --metrics.port 6060
``` ```
Navigating the browser to the given metrics address displays all the available metrics in the form Navigating the browser to the given metrics address displays all the available metrics in the form