From 2183858d7718072fa487a77e8d492a7aa75122d6 Mon Sep 17 00:00:00 2001 From: Arash Deshmeh Date: Fri, 20 Jun 2025 17:19:29 -0400 Subject: [PATCH 1/9] Sanction endpoints on nil supplier public key --- protocol/shannon/sanctions.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/protocol/shannon/sanctions.go b/protocol/shannon/sanctions.go index 4a2500a6d..a8584f961 100644 --- a/protocol/shannon/sanctions.go +++ b/protocol/shannon/sanctions.go @@ -36,11 +36,15 @@ func classifyRelayError(logger polylog.Logger, err error) (protocolobservations. return protocolobservations.ShannonEndpointErrorType_SHANNON_ENDPOINT_ERROR_RESPONSE_GET_PUBKEY_ERR, protocolobservations.ShannonSanctionType_SHANNON_SANCTION_SESSION - // Received nil public key on supplier lookup using its address + // Received nil public key on supplier lookup using its address. + // This means the supplier account is not properly initialized: + // + // In Cosmos SDK (and thus in pocketd) accounts: + // - Are created when they receive tokens. + // - Get their public key onchain once they sign their first transaction (e.g. send, delegate, stake, etc.) case errors.Is(err, sdk.ErrRelayResponseValidationNilSupplierPubKey): return protocolobservations.ShannonEndpointErrorType_SHANNON_ENDPOINT_ERROR_NIL_SUPPLIER_PUBKEY, - // No sanctions needed: supplier address is provided by PATH. - protocolobservations.ShannonSanctionType_SHANNON_SANCTION_UNSPECIFIED + protocolobservations.ShannonSanctionType_SHANNON_SANCTION_SESSION // RelayResponse's signature failed validation. case errors.Is(err, sdk.ErrRelayResponseValidationSignatureError): From 8720738ab3b2d495ee883249ec419ddd21f190aa Mon Sep 17 00:00:00 2001 From: Arash Deshmeh Date: Mon, 23 Jun 2025 18:02:00 -0400 Subject: [PATCH 2/9] Update docs and tools to simplify running Load Tests --- ...tsheet_morse.md => 10_cheatsheet_morse.md} | 2 +- .../docs/develop/path/1_introduction.md | 62 ---- docusaurus/docs/develop/path/1_quick_start.md | 40 +++ .../docs/develop/path/2_cheatsheet_shannon.md | 308 +++++++++++++++++ docusaurus/docs/develop/path/2_environment.md | 97 ------ .../docs/develop/path/3_cheatsheet_shannon.md | 326 ------------------ docusaurus/docs/develop/path/3_e2e_tests.md | 141 ++++++++ docusaurus/docs/develop/path/4_load_tests.md | 66 ++++ .../develop/path/5_deep_dive_e2e_tests.md | 168 +++++++++ .../develop/path/6_deep_dive_load_tests.md | 141 ++++++++ .../develop/path/7_deep_dive_develop_env.md | 41 +++ .../docs/develop/path/7_e2e_and_load_tests.md | 285 --------------- ...s_path.md => 8_ref_configurations_path.md} | 4 +- ...s_helm.md => 9_ref_configurations_helm.md} | 4 +- e2e/config/e2e_load_test.config.tmpl.yaml | 175 +++++++--- local/scripts/install_tools.sh | 59 +++- makefiles/deps.mk | 4 +- 17 files changed, 1081 insertions(+), 842 deletions(-) rename docusaurus/docs/develop/path/{4_cheatsheet_morse.md => 10_cheatsheet_morse.md} (99%) delete mode 100644 docusaurus/docs/develop/path/1_introduction.md create mode 100644 docusaurus/docs/develop/path/1_quick_start.md create mode 100644 docusaurus/docs/develop/path/2_cheatsheet_shannon.md delete mode 100644 docusaurus/docs/develop/path/2_environment.md delete mode 100644 docusaurus/docs/develop/path/3_cheatsheet_shannon.md create mode 100644 docusaurus/docs/develop/path/3_e2e_tests.md create mode 100644 docusaurus/docs/develop/path/4_load_tests.md create mode 100644 docusaurus/docs/develop/path/5_deep_dive_e2e_tests.md create mode 100644 docusaurus/docs/develop/path/6_deep_dive_load_tests.md create mode 100644 docusaurus/docs/develop/path/7_deep_dive_develop_env.md delete mode 100644 docusaurus/docs/develop/path/7_e2e_and_load_tests.md rename docusaurus/docs/develop/path/{5_configurations_path.md => 8_ref_configurations_path.md} (99%) rename docusaurus/docs/develop/path/{6_configurations_helm.md => 9_ref_configurations_helm.md} (98%) mode change 100755 => 100644 local/scripts/install_tools.sh diff --git a/docusaurus/docs/develop/path/4_cheatsheet_morse.md b/docusaurus/docs/develop/path/10_cheatsheet_morse.md similarity index 99% rename from docusaurus/docs/develop/path/4_cheatsheet_morse.md rename to docusaurus/docs/develop/path/10_cheatsheet_morse.md index b65e08e78..28c5ae924 100644 --- a/docusaurus/docs/develop/path/4_cheatsheet_morse.md +++ b/docusaurus/docs/develop/path/10_cheatsheet_morse.md @@ -1,5 +1,5 @@ --- -sidebar_position: 4 +sidebar_position: 10 title: Morse Cheat Sheet (30-60 min) description: Introductory guide for setting up PATH w/ Morse --- diff --git a/docusaurus/docs/develop/path/1_introduction.md b/docusaurus/docs/develop/path/1_introduction.md deleted file mode 100644 index f767ca010..000000000 --- a/docusaurus/docs/develop/path/1_introduction.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -sidebar_position: 1 -title: Quick Introduction (1 min) -description: Quick intro & where to get started ---- - -
-

PATH API & Toolkit Harness

-Grove logo - -
-
- -![Static Badge](https://img.shields.io/badge/Maintained_by-Grove-green) -![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/buildwithgrove/path/main-build.yml) -![GitHub last commit](https://img.shields.io/github/last-commit/buildwithgrove/path) -![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/buildwithgrove/path) -![GitHub Release](https://img.shields.io/github/v/release/buildwithgrove/path) -![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/buildwithgrove/path/total) -![GitHub Issues or Pull Requests](https://img.shields.io/github/issues/buildwithgrove/path) -![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-pr/buildwithgrove/path) -![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-closed/buildwithgrove/path) -![App Status](https://argocd.tooling.buildintheshade.com/api/badge?name=path-gateway&revision=true&showAppName=true) - -**PATH (Path API & Toolkit Harness)** is an open source framework to enable access -to a permissionless network of API providers of open source services and data -sources without sacrificing enterprise-grade SLAs. - -## Table of Contents - -- [Where to start?](#where-to-start) -- [Special Thanks](#special-thanks) -- [License](#license) - -## Where to start? - -If you're unsure of where to start, we recommend the following: - -1. [**Environment Setup**](2_environment.md): Prepare your environment for running PATH -2. [**Configuration Files**](6_configurations_helm.md): Explore other PATH configuration files -3. [**Shannon Cheat Sheet**](3_cheatsheet_shannon.md): Get up and running with a Gateway to Shannon -4. [**Morse Cheat Sheet**](4_cheatsheet_morse.md): Get up and running with a Gateway to Morse if you're feeling adventurous - -## Special Thanks - -The origins of this repository were inspired by the work kicked off in [gateway-server](https://github.com/pokt-network/gateway-server) by the -[Nodies](https://nodies.app/) team. We were inspired and heavily considering forking and building off of that effort. - -However, after a week-long sprint, the team deemed that starting from scratch was the better path forward for multiple reasons. These include but are not limited to: - -- Enabling multi-protocol support; Morse, Shanon and beyond -- Set a foundation to migrate Grove's quality of service and data pipelineta -- Integrating with web2 standards like [Envoy](https://www.envoyproxy.io/), [gRPC](https://grpc.io/), [Stripe](https://stripe.com/), [NATS](https://nats.io/), [Auth0](https://auth0.com/), etc... -- Etc... - - - ---- - -## License - -This project is licensed under the MIT License; see the [LICENSE](https://github.com/buildwithgrove/path/blob/main/LICENSE) file for details. diff --git a/docusaurus/docs/develop/path/1_quick_start.md b/docusaurus/docs/develop/path/1_quick_start.md new file mode 100644 index 000000000..349e1b460 --- /dev/null +++ b/docusaurus/docs/develop/path/1_quick_start.md @@ -0,0 +1,40 @@ +--- +sidebar_position: 1 +title: Quick Start (< 10 min) +description: Quick intro and environment setup +--- + +
+

PATH API & Toolkit Harness

+Grove logo + +
+
+ +![Static Badge](https://img.shields.io/badge/Maintained_by-Grove-green) +![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/buildwithgrove/path/main-build.yml) +![GitHub last commit](https://img.shields.io/github/last-commit/buildwithgrove/path) +![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/buildwithgrove/path) +![GitHub Release](https://img.shields.io/github/v/release/buildwithgrove/path) +![GitHub Downloads (all assets, all releases)](https://img.shields.io/github/downloads/buildwithgrove/path/total) +![GitHub Issues or Pull Requests](https://img.shields.io/github/issues/buildwithgrove/path) +![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-pr/buildwithgrove/path) +![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-closed/buildwithgrove/path) +![App Status](https://argocd.tooling.buildintheshade.com/api/badge?name=path-gateway&revision=true&showAppName=true) + +# Quick Start + +**1. Clone the repository**: +```bash +git clone https://github.com/buildwithgrove/path.git +cd ./path +``` + +**2. Install all dependencies**: +```bash +make install_tools +``` + +# What's Next + +**[Shannon Cheat Sheet](3_cheatsheet_shannon.md)** - Configure PATH for the Shannon protocol \ No newline at end of file diff --git a/docusaurus/docs/develop/path/2_cheatsheet_shannon.md b/docusaurus/docs/develop/path/2_cheatsheet_shannon.md new file mode 100644 index 000000000..8400a66b7 --- /dev/null +++ b/docusaurus/docs/develop/path/2_cheatsheet_shannon.md @@ -0,0 +1,308 @@ +--- +sidebar_position: 2 +title: Shannon Cheat Sheet (30-60 min) +description: Introductory guide for setting up PATH w/ Shannon +--- + +Set up `PATH` with Pocket Network's **Shannon** protocol. + +Shannon status: Beta TestNet (01/2025), Private MainNet (04/2025). + +## Grove Employees: Quick Config + +1. Download the preferred config file from 1Password: + - **[Shannon MainNet](https://start.1password.com/open/i?a=4PU7ZENUCRCRTNSQWQ7PWCV2RM&v=kudw25ob4zcynmzmv2gv4qpkuq&i=4ifsnkuifvaggwgptns6xyglsa&h=buildwithgrove.1password.com)** - For testing on MainNet + - **[Shannon Beta TestNet](https://start.1password.com/open/i?a=4PU7ZENUCRCRTNSQWQ7PWCV2RM&v=kudw25ob4zcynmzmv2gv4qpkuq&i=3treknedz5q47rgwdbreluwffu&h=buildwithgrove.1password.com)** - For testing on Beta TestNet +2. Copy to `local/path/.config.yaml` **in your PATH repository** +3. Skip to [section 3: Run PATH](#3-run-path-in-development-mode) + +:::tip Skip to section 2.1 + +Coming from the [App & PATH Gateway Cheat Sheet](https://dev.poktroll.com/operate/cheat_sheets/gateway_cheatsheet)? Start at [2.1 Generate Shannon Config](#21-generate-shannon-config). + +::: + +## Table of Contents + +- [0. Prerequisites](#0-prerequisites) +- [1. Setup Shannon Protocol Accounts (Gateway \& Application)](#1-setup-shannon-protocol-accounts-gateway--application) + - [1.1 Gateway and Application Account Creation](#11-gateway-and-application-account-creation) + - [1.2 `Application` and `Gateway` Account Validation](#12-application-and-gateway-account-validation) +- [2. Configure PATH for Shannon](#2-configure-path-for-shannon) + - [2.1 Generate Shannon Config](#21-generate-shannon-config) + - [2.2 Manual Configuration Verification](#22-manual-configuration-verification) + - [2.3 Ensure onchain configuration matches](#23-ensure-onchain-configuration-matches) + - [2.4 (Optional) Disable QoS Hydrator Checks](#24-optional-disable-qos-hydrator-checks) +- [3. Run PATH in development mode](#3-run-path-in-development-mode) + - [3.1 Start PATH](#31-start-path) + - [3.2 Monitor PATH](#32-monitor-path) +- [4. Test Relays](#4-test-relays) + - [Test Relay with `curl`](#test-relay-with-curl) + - [Test Relay with `make`](#test-relay-with-make) + - [Load Testing with `relay-util`](#load-testing-with-relay-util) +- [5. Stop PATH](#5-stop-path) + +## 0. Prerequisites + +Complete the [**Quick Start**](1_getting_started.md) guide. + +## 1. Setup Shannon Protocol Accounts (Gateway & Application) + +You need: +1. **[Gateway](https://docs.pokt.network/pokt-protocol/the-shannon-upgrade/shannon-actors/gateways)**: Facilitates relays and ensures QoS +2. **[Application](https://docs.pokt.network/pokt-protocol/the-shannon-upgrade/shannon-actors/sovereign-applications)**: Pays for relays (API key holder) + +### 1.1 Gateway and Application Account Creation + +**Recommended**: Follow the [**App & PATH Gateway Cheat Sheet**](https://dev.poktroll.com/operate/cheat_sheets/gateway_cheatsheet) for complete setup. + +**Quick setup** (first-time users): + +
+ +Copy-pasta to stake onchain Application & Gateway + +**Create gateway stake config:** + +```bash +cat <<🚀 > /tmp/stake_gateway_config.yaml +stake_amount: 1000000upokt +🚀 +``` + +**Create application stake config:** + +```bash +cat <<🚀 > /tmp/stake_app_config.yaml +stake_amount: 100000000upokt +service_ids: + - "anvil" +🚀 +``` + +**Create accounts:** + +```bash +pocketd keys add gateway +pocketd keys add application +``` + +**Fund accounts**: Use faucet links [here](https://dev.poktroll.com/category/explorers-faucets-wallets-and-more). + +:::tip Grove employees only + +Fund using `pkd_beta_tx` helper ([instructions](https://www.notion.so/buildwithgrove/Shannon-Alpha-Beta-Environment-rc-helpers-152a36edfff680019314d468fad88864?pvs=4)): + +```bash +pkd_beta_tx bank send faucet_beta $(pkd keys show -a application) 6900000000042upokt +pkd_beta_tx bank send faucet_beta $(pkd keys show -a gateway) 6900000000042upokt +``` + +::: + +**Stake gateway:** + +```bash +pocketd tx gateway stake-gateway \ + --config=/tmp/stake_gateway_config.yaml \ + --from=gateway --gas=auto --gas-prices=200upokt --gas-adjustment=1.5 --chain-id=pocket-beta \ + --node=https://shannon-testnet-grove-rpc.beta.poktroll.com \ + --yes +``` + +**Stake application:** + +```bash +pocketd tx application stake-application \ + --config=/tmp/stake_app_config.yaml \ + --from=application --gas=auto --gas-prices=200upokt --gas-adjustment=1.5 --chain-id=pocket-beta \ + --node=https://shannon-testnet-grove-rpc.beta.poktroll.com \ + --yes +``` + +**Delegate application to gateway:** + +```bash +pocketd tx application delegate-to-gateway $(pocketd keys show -a gateway) \ + --from=application --gas=auto --gas-prices=200upokt --gas-adjustment=1.5 --chain-id=pocket-beta \ + --node=https://shannon-testnet-grove-rpc.beta.poktroll.com \ + --yes +``` + +
+ +### 1.2 Account Validation + +Verify your keys: + +```bash +# All accounts +pocketd keys list + +# Gateway only +pocketd keys show -a gateway + +# Application only +pocketd keys show -a application +``` + +## 2. Configure PATH for Shannon + +### 2.1 Generate Shannon Config + +Generate config at `local/path/.config.yaml`: + +```bash +make shannon_populate_config +``` + +:::important Environment variables + +Override defaults if needed: + +- `POCKETD_HOME`: Path to pocketd home (default `$HOME/.pocketd`) +- `POCKETD_KEYRING_BACKEND`: Keyring backend (default `test`) + +::: + +### 2.2 Manual Configuration Verification + +Check config: + +```bash +cat local/path/.config.yaml +``` + +Expected format: + +```yaml +shannon_config: + full_node_config: + rpc_url: https://shannon-testnet-grove-rpc.beta.poktroll.com + grpc_config: + host_port: shannon-testnet-grove-grpc.beta.poktroll.com:443 + lazy_mode: false + gateway_config: + gateway_mode: "centralized" + gateway_address: pokt1... # Your gateway address + gateway_private_key_hex: "0x..." # Your gateway private key + owned_apps_private_keys_hex: + - "0x..." # Your application private key +``` + +### 2.3 Ensure onchain configuration matches + +Verify service configuration for each application: + +```bash +pocketd query application show-application \ + $(pkd keys show -a application) \ + --node=https://shannon-testnet-grove-rpc.beta.poktroll.com +``` + +### 2.4 (Optional) Disable QoS Hydrator Checks + +QoS hydrator runs checks on all configured services by default. + +To disable for specific services, add `qos_disabled_service_ids` to `.config.yaml`. + +**Use cases**: Testing and development. + +**More info**: +- [PATH Configuration File](./5_configurations_path.md#hydrator_config-optional) +- [Supported QoS Services](../../learn/qos/1_supported_services.md) + +:::tip + +Check configured services: + +```bash +curl http://localhost:3069/healthz +``` + +::: + +## 3. Run PATH in development mode + +### 3.1 Start PATH + +Start PATH in Tilt: + +```bash +make path_up +``` + +### 3.2 Monitor PATH + +:::warning Grab a ☕ +First startup takes a few minutes for `path`, `guard` and `watch`. +::: + +**Console output** (~30 seconds): + +![Tilt Output in Console](../../../static/img/path-in-tilt-console.png) + +**Tilt dashboard**: Visit [localhost:10350]() + +![Tilt Dashboard in Browser](../../../static/img/path-in-tilt.png) + +## 4. Test Relays + +:::warning Anvil Node & Request Retries + +Retry requests if first attempt fails. `anvil` node may not always be available. + +::: + +### Test Relay with `curl` + +Test block height: + +```bash +curl http://localhost:3070/v1 \ + -H "Target-Service-Id: anvil" \ + -H "Authorization: test_api_key" \ + -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber" }' +``` + +Expected response: + +```json +{"id":1,"jsonrpc":"2.0","result":"0x2f01a"}% +``` + +### Test Relay with `make` + +Use makefile helpers (see `makefiles/test_requests.mk`): + +```bash +make test_request__shannon_service_id_header +``` + +View all helpers: + +```bash +make help +``` + +### Load Testing with `relay-util` + +Send 100 requests with performance metrics: + +```bash +make test_request__shannon_relay_util_100 +``` + +:::note TODO: Screenshots + +Add screenshot of output. + +::: + +## 5. Stop PATH + +When you're finished testing and want to stop PATH: + +```bash +make path_down +``` \ No newline at end of file diff --git a/docusaurus/docs/develop/path/2_environment.md b/docusaurus/docs/develop/path/2_environment.md deleted file mode 100644 index 821c47323..000000000 --- a/docusaurus/docs/develop/path/2_environment.md +++ /dev/null @@ -1,97 +0,0 @@ ---- -sidebar_position: 2 -title: Environment Setup (< 10 min) -description: Pre-requisite to setup your local environment ---- - -This guide provides instructions required to setup your environment for local development. -locally in a development environment. - -It is a pre-requisite for both the: - -- [**Shannon Protocol Guide**](3_cheatsheet_shannon.md): Pocket Network v1 (Private MainNet as of 04/2025) -- [**Morse Protocol Guide**](4_cheatsheet_morse.md): For the original Morse protocol (Public MainNet as of 2020) - -## Table of Contents - -- [Development Environment Details](#development-environment-details) -- [Technical Pre-Requisites \& Setup](#technical-pre-requisites--setup) - - [1. Clone the Repository](#1-clone-the-repository) - - [2. Install Required Tools (Linux \& MacOS)](#2-install-required-tools-linux--macos) - - [Install `pocketd` CLI](#install-pocketd-cli) - - [Install Required Local Tools](#install-required-local-tools) - - [3. Choose Your Protocol](#3-choose-your-protocol) - -## Development Environment Details - -
- - Tilt logo -

Tilt Documentation

-
-
- -**PATH**'s development mode uses a Kubernetes-based local development environment with [Tilt](https://tilt.dev/). - -We use [Kind](https://kind.sigs.k8s.io/) (Kubernetes in Docker) for running the local Kubernetes cluster, as it provides better compatibility with Tilt's -image building process compared to Docker Desktop's Kubernetes cluster. - -## Technical Pre-Requisites & Setup - -### 1. Clone the Repository - -```bash -git clone https://github.com/buildwithgrove/path.git -cd ./path -``` - -### 2. Install Required Tools (Linux & MacOS) - -#### Install `pocketd` CLI - -To install the [`pocketd` CLI](https://dev.poktroll.com/category/pocketd-cli) on Linux or MacOS, run: - -```bash -curl -sSL https://raw.githubusercontent.com/pokt-network/poktroll/main/scripts/install.sh | bash -``` - -#### Install Required Local Tools - -To install all required local development tools on Linux or MacOS, run: - -```bash -make install_tools -``` - -The above script will install the following tools which are required to start a PATH instance locally in development mode: - -- [**Docker**](https://docs.docker.com/get-docker/): Container runtime -- [**Kind**](https://kind.sigs.k8s.io/#installation-and-usage): Local Kubernetes cluster -- [**kubectl**](https://kubernetes.io/docs/tasks/tools/#kubectl): CLI for interacting with Kubernetes -- [**Helm**](https://helm.sh/docs/intro/install/): Package manager for Kubernetes -- [**Tilt**](https://docs.tilt.dev/install.html): Local Kubernetes development environment - -:::tip - -The following optional tools may be helpful for your development workflow but are not required to start a PATH instance locally in development mode: - -- [**Relay Util**](https://github.com/commoddity/relay-util): An easy to use load testing tool for sending configurable batches of relays concurrently -- [**Graphviz**](https://graphviz.org): Required for generating profiling & debugging performance -- [**Uber Mockgen**](https://github.com/uber-go/mock): Mock interface generator for testing - -They may be installed with: - -```bash -make install_optional_tools -``` - -::: - -### 3. Choose Your Protocol - -Pick one of these protocols and follow the respective guide. - -| Protocol | Version (aka) | Status (04/2025) | Network | Documentation | -| -------- | ------------- | ---------------------- | ------- | ------------------------------------------------- | -| Shannon | v1 | Beta & Private MainNet | TestNet | [Shannon Protocol Guide](3_cheatsheet_shannon.md) | -| Morse | v0 | MainNet (2020) | MainNet | [Morse Protocol Guide](4_cheatsheet_morse.md) | diff --git a/docusaurus/docs/develop/path/3_cheatsheet_shannon.md b/docusaurus/docs/develop/path/3_cheatsheet_shannon.md deleted file mode 100644 index 63032140a..000000000 --- a/docusaurus/docs/develop/path/3_cheatsheet_shannon.md +++ /dev/null @@ -1,326 +0,0 @@ ---- -sidebar_position: 3 -title: Shannon Cheat Sheet (30-60 min) -description: Introductory guide for setting up PATH w/ Shannon ---- - -This guide covers setting up `PATH` with Pocket Network's **Shannon** protocol. - -Shannon is in Beta TestNet as of 01/2025 and private MainNet as of 04/2025. - -:::tip Skip to section 2.1 - -If you are arriving here from the [App & PATH Gateway Cheat Sheet](https://dev.poktroll.com/operate/cheat_sheets/gateway_cheatsheet) -in the `poktroll` documentation, you should start the walkthrough from [2.1 Generate Shannon Config](#21-generate-shannon-config). - -::: - -## Table of Contents - -- [0. Prerequisites](#0-prerequisites) -- [1. Setup Shannon Protocol Accounts (Gateway \& Application)](#1-setup-shannon-protocol-accounts-gateway--application) - - [1.1 Gateway and Application Account Creation](#11-gateway-and-application-account-creation) - - [1.2 `Application` and `Gateway` Account Validation](#12-application-and-gateway-account-validation) -- [2. Configure PATH for Shannon](#2-configure-path-for-shannon) - - [2.1 Generate Shannon Config](#21-generate-shannon-config) - - [2.2 Manual Configuration Verification](#22-manual-configuration-verification) - - [2.3 Ensure onchain configuration matches](#23-ensure-onchain-configuration-matches) - - [2.4 (Optional) Disable QoS Hydrator Checks](#24-optional-disable-qos-hydrator-checks) -- [3. Run PATH in development mode](#3-run-path-in-development-mode) - - [3.1 Start PATH](#31-start-path) - - [3.2 Monitor PATH](#32-monitor-path) -- [4. Test Relays](#4-test-relays) - - [Test Relay with `curl`](#test-relay-with-curl) - - [Test Relay with `make`](#test-relay-with-make) - - [Load Testing with `relay-util`](#load-testing-with-relay-util) - -## 0. Prerequisites - -1. Prepare your environment by following the instructions in the [**environment setup**](2_environment.md) guide. -2. Install the [**`pocketd` CLI**](https://dev.poktroll.com/tools/user_guide/pocketd_cli) to interact with [Pocket Network's Shannon Network](https://dev.poktroll.com). - -:::tip - -You can use the `make install_deps` command to install the dependencies for the PATH stack, **including** the `pocketd` CLI. - -::: - -## 1. Setup Shannon Protocol Accounts (Gateway & Application) - -Before starting, you'll need to create and configure: - -1. **An onchain [Gateway](https://docs.pokt.network/pokt-protocol/the-shannon-upgrade/shannon-actors/gateways)**: An onchain actor that **facilitates** _(i.e. proxies)_ relays to ensure Quality of Service (QoS) -2. **An onchain [Application](https://docs.pokt.network/pokt-protocol/the-shannon-upgrade/shannon-actors/sovereign-applications)**: An onchain actor that **pays** _(i.e. the API key holder)_ for relays - -### 1.1 Gateway and Application Account Creation - -We **strongly** recommend following the [**App & PATH Gateway Cheat Sheet**](https://dev.poktroll.com/operate/cheat_sheets/gateway_cheatsheet) for setting up your accounts and getting a thorough understanding of all the elements. - -But, if this is your first time going through the docs, you can follow the copy-pasta instructions -below to get a feel for the end-to-end process. - -
- -tl;dr Copy-pasta to stake onchain Application & Gateway - -**Prepare a gateway stake config:** - -```bash -cat <<🚀 > /tmp/stake_gateway_config.yaml -stake_amount: 1000000upokt -🚀 -``` - -**Prepare an application stake config:** - -```bash -cat <<🚀 > /tmp/stake_app_config.yaml -stake_amount: 100000000upokt -service_ids: - - "anvil" -🚀 -``` - -**Create gateway and application accounts in your keyring:** - -```bash -pocketd keys add gateway -pocketd keys add application -``` - -Fund the accounts by finding a link to the faucet [here](https://dev.poktroll.com/category/explorers-faucets-wallets-and-more). - -:::tip Grove employees only - -You can manually fund the accounts using the `pkd_beta_tx` helper by following the instructions [in this notion doc](https://www.notion.so/buildwithgrove/Shannon-Alpha-Beta-Environment-rc-helpers-152a36edfff680019314d468fad88864?pvs=4): - -```bash -pkd_beta_tx bank send faucet_beta $(pkd keys show -a application) 6900000000042upokt -pkd_beta_tx bank send faucet_beta $(pkd keys show -a gateway) 6900000000042upokt -``` - -::: - -**Stake the gateway:** - -```bash -pocketd tx gateway stake-gateway \ - --config=/tmp/stake_gateway_config.yaml \ - --from=gateway --gas=auto --gas-prices=200upokt --gas-adjustment=1.5 --chain-id=pocket-beta \ - --node=https://shannon-testnet-grove-rpc.beta.poktroll.com \ - --yes -``` - -**Stake the application:** - -```bash -pocketd tx application stake-application \ - --config=/tmp/stake_app_config.yaml \ - --from=application --gas=auto --gas-prices=200upokt --gas-adjustment=1.5 --chain-id=pocket-beta \ - --node=https://shannon-testnet-grove-rpc.beta.poktroll.com \ - --yes -``` - -**Delegate from the application to the gateway:** - -```bash -pocketd tx application delegate-to-gateway $(pocketd keys show -a gateway) \ - --from=application --gas=auto --gas-prices=200upokt --gas-adjustment=1.5 --chain-id=pocket-beta \ - --node=https://shannon-testnet-grove-rpc.beta.poktroll.com \ - --yes -``` - -
- -### 1.2 `Application` and `Gateway` Account Validation - -After following the instructions above, you should have keys with the names `gateway` and `application` in your keyring. - -You can validate it like so: - -```bash -# All accounts -pocketd keys list - -# Gateway only -pocketd keys show -a gateway - -# Application only -pocketd keys show -a application -``` - -## 2. Configure PATH for Shannon - -### 2.1 Generate Shannon Config - -Run the following command to generate a Shannon config at `local/path/.config.yaml`: - -```bash -make shannon_populate_config -``` - -:::important Command configuration - -This command relies on `pocketd` command line interface to export the **Gateway** and **Application** address from your keyring backend. - -You can set the following environment variables to override the default values: - -- `POCKETD_HOME`: Path to the `pocketd` home directory (default `$HOME/.pocketd`) -- `POCKETD_KEYRING_BACKEND`: Keyring backend to use (default `test`) - -::: - -### 2.2 Manual Configuration Verification - -Check your config file: - -```bash -cat local/path/.config.yaml -``` - -It should look similar to the following with the `gateway_config` filled out. - -```yaml -shannon_config: - full_node_config: - rpc_url: https://shannon-testnet-grove-rpc.beta.poktroll.com - grpc_config: - host_port: shannon-testnet-grove-grpc.beta.poktroll.com:443 - lazy_mode: false - gateway_config: - gateway_mode: "centralized" - gateway_address: pokt1... # Your gateway address - gateway_private_key_hex: "0x..." # Your gateway private key - owned_apps_private_keys_hex: - - "0x..." # Your application private key -``` - -### 2.3 Ensure onchain configuration matches - -Double check the onchain configuration are configured for the `service_ids` you expect. - -Repeat this command for each addresses associated with `owned_apps_private_keys_hex`. - -```bash -pocketd query application show-application \ - $(pkd keys show -a application) \ - --node=https://shannon-testnet-grove-rpc.beta.poktroll.com -``` - -### 2.4 (Optional) Disable QoS Hydrator Checks - -By default, the QoS hydrator will run checks against all services that applications configured in the `shannon_config.owned_apps_private_keys_hex` section are staked for. - -To manually disable QoS checks for a specific service, the `qos_disabled_service_ids` field may be specified in the `.config.yaml` file. - -This is primarily useful for testing and development purposes. It is unlikely you'll need this -feature unless you are customizing QoS modules yourself. - -For more information, see: - -- [PATH Configuration File](./5_configurations_path.md#hydrator_config-optional) -- [Supported QoS Services](../../learn/qos/1_supported_services.md) - -:::tip - -To see the list of services that PATH is configured for, you can use the `/healthz` endpoint. - -```bash -curl http://localhost:3069/healthz -``` - -::: - -## 3. Run PATH in development mode - -### 3.1 Start PATH - -Run PATH in local development mode in Tilt by running: - -```bash -make path_up -``` - -You can stop the PATH stack by running: - -```bash -make path_down -``` - -### 3.2 Monitor PATH - -:::warning Grab a ☕ -It could take a few minutes for `path`, `guard` and `watch` to start up the first time. -::: - -You should see an output similar to the following relatively quickly (~30 seconds): - -![Tilt Output in Console](../../../static/img/path-in-tilt-console.png) - -Once you see the above log, visit [localhost:10350]() to view the Tilt dashboard. - -![Tilt Dashboard in Browser](../../../static/img/path-in-tilt.png) - -## 4. Test Relays - -:::warning Anvil Node & Request Retries - -_tl;dr Retry the requests below if the first one fails._ - -The instructions above were written to get you to access an [**anvil**](https://book.getfoundry.sh/anvil/) node accessible on Pocket Network. - -Since `anvil` is an Ethereum node used for testing, there is a chance it may not be available. - -We recommend you try the instructions below a few times to ensure you can get a successful relay. Otherwise, reach out to the community on Discord. - -::: - -### Test Relay with `curl` - -Send a test relay to check the height of - -```bash -curl http://localhost:3070/v1 \ - -H "Target-Service-Id: anvil" \ - -H "Authorization: test_api_key" \ - -d '{"jsonrpc": "2.0", "id": 1, "method": "eth_blockNumber" }' -``` - -And you should expect to see a response similar to the following: - -```json -{"id":1,"jsonrpc":"2.0","result":"0x2f01a"}% -``` - -### Test Relay with `make` - -For your convenience, we have provided a few makefile helpers to test relays with `curl` and `jq`. -You can find that in the `makefiles/test_requests.mk` file. - -For example, to mimic the `curl` command above, you can simply run: - -```bash -make test_request__shannon_service_id_header -``` - -To see all available helpers, simply run: - -```bash -make help -``` - -### Load Testing with `relay-util` - -You can use the `relay-util` tool to load test your relays. - -The following will send 100 requests to the `anvil` node and give you performance metrics. - -```bash -make test_request__shannon_relay_util_100 -``` - -:::note TODO: Screenshots - -Add a screenshot of the output. - -::: diff --git a/docusaurus/docs/develop/path/3_e2e_tests.md b/docusaurus/docs/develop/path/3_e2e_tests.md new file mode 100644 index 000000000..43592c428 --- /dev/null +++ b/docusaurus/docs/develop/path/3_e2e_tests.md @@ -0,0 +1,141 @@ +--- +sidebar_position: 3 +title: E2E Tests +description: End-to-End Tests for PATH +--- + +**Goal of this document**: Fully featured E2E Tests to verify PATH works correctly. + + + +## E2E Tests + +**Prerequisites**: Complete the [Quick Start](1_quick_start.md) and [Shannon Cheat Sheet](2_cheatsheet_shannon.md) guides. + +```bash +# Shannon E2E tests with all service IDs +make e2e_test_all + +# Shannon E2E tests with specified service IDs only +make e2e_test eth,anvil +``` + +## Overview + +**The E2E tests verify:** + +- Correct request routing +- Service responses (data + latency) +- System reliability under load +- Success metrics for Shannon protocol + +**We use the [Vegeta library](https://github.com/tsenart/vegeta) for HTTP load testing:** + +- Can generate thousands of requests/sec +- Collects detailed metrics including latency percentiles (p50, p95, p99) +- Supports custom configurations and attack parameters +- Validates JSON-RPC responses and success rates + +
+![Vegeta](../../../static/img/9000.png) +
+ +## E2E Test Mode + +PATH E2E tests run in a single mode: + +| Mode | Make Targets | Purpose | How it Works | Use Cases | +| ------------- | --------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| **E2E Test** | `make e2e_test` | Full end-to-end testing that starts PATH in an isolated Docker container | 1. Spins up PATH in a Docker container using Dockertest
2. Uses protocol config (`.shannon.config.yaml`)
3. Runs tests
4. Tears down container | - Full system validation
- Continuous integration
- Regression testing | + +### E2E Test Config Files + +E2E Test mode requires protocol-specific configuration because it spins up a local PATH instance. + +| Configuration File | E2E Test (Required?) | Default available? | +| -------------------------------------------------- | :------------------: | :-----------------------------------------: | +| `./e2e/config/.shannon.config.yaml` (for Shannon) | ✅ | ❌ | +| `./e2e/config/.e2e_load_test.config.yaml` (custom) | ❌ | `e2e/config/e2e_load_test.config.tmpl.yaml` | + +:::tip Populate Configs + +You can use the following command to copy example configs and follow the instructions in your CLI: + +For E2E tests: + +- `make shannon_prepare_e2e_config` + +::: + +### Schema and Validation + +The configuration uses a formal YAML schema with validation: + +**Schema Location**: `./e2e/config/e2e_load_test.config.schema.yaml` + +:::tip VSCode Validation + +If you are using VSCode, we recommend using the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension for in-editor validation of the `.config.yaml` file. + +Enable it by ensuring the following annotation is present at the top of your config file: + +```yaml +# yaml-language-server: $schema=https://raw.githubusercontent.com/buildwithgrove/path/refs/heads/main/e2e/config/e2e_load_test.config.schema.yaml +``` + +::: + +### Supported Services in E2E Tests + +**All currently supported Grove Portal services are supported in the E2E tests.** + +:::tip + +To see the list of supported services for the tests, see the `test_cases` array in the [E2E Test Config](https://github.com/buildwithgrove/path/blob/main/e2e/config/e2e_load_test.config.tmpl.yaml) file. + +::: + +### Environment Variables + +These environment variables are set by the test make targets, but if you wish to set them manually, see the table below: + +
+Env Vars Table +| Variable | Description | Values | Required | +| ---------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------- | -------- | +| TEST_MODE | Determines the test execution mode | `e2e` | Yes | +| TEST_PROTOCOL | Specifies which protocol to test | `shannon` | Yes | +| TEST_SERVICE_IDS | Specifies which service IDs to test. If not set, all service IDs for the protocol will be tested. | Comma-separated list of service IDs | No | +
+ +### Extending/Updating/Adding EVM E2E Tests + +To add new services or methods to the E2E tests, you will need to open a new PR to PATH's `main` branch. + +1. **Add new service definitions** to the `services` array in the `e2e/config/services_shannon.yaml` configuration file +2. **Configure service parameters** including contract addresses, start blocks, and transaction hashes for archival tests + +**Example new service configuration:** + +_`./config/services_shannon.yaml`_ + +```yaml +services: + - name: "New Chain E2E Test" + protocol: "shannon" + service_id: "newchain" + archival: true + service_params: + contract_address: "0x..." + contract_start_block: 1000000 + transaction_hash: "0x..." + call_data: "0x18160ddd" +``` + +### Test Metrics and Validation + +The E2E tests collect and validate comprehensive metrics across multiple dimensions: + +| **Category** | **Metrics Collected** | +| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **HTTP Metrics** | \ No newline at end of file diff --git a/docusaurus/docs/develop/path/4_load_tests.md b/docusaurus/docs/develop/path/4_load_tests.md new file mode 100644 index 000000000..bf0b9163d --- /dev/null +++ b/docusaurus/docs/develop/path/4_load_tests.md @@ -0,0 +1,66 @@ +--- +sidebar_position: 4 +title: Load Tests +description: Load Tests for PATH +--- +## Load Testing Local PATH (Recommended for most users) + +**Prerequisites**: Complete the [Quick Start](1_quick_start.md) and [Shannon Cheat Sheet](2_cheatsheet_shannon.md) guides. + +```bash +# Shannon load tests with specified service IDs only +make load_test eth,anvil + +# Shannon load tests with all service IDs +make load_test_all +``` + + + +--- + +
+ +:::warning Production Grove Portal Testing Only + +**🛑 STOP HERE if you only need local PATH testing!** + +The remainder of this document is only relevant if you intend to load test the Grove Portal in production. If you're only testing your local PATH instance, the commands above are sufficient. + +::: + +
+ +## Load Testing the Grove Portal +:::warning **Prerequisites**: Complete the [Quick Start](1_quick_start.md) guide. +::: + +:::info 🏢 **Grove Employees** + +You can obtain the required Portal Application ID and API Key from the [1Password link](1Password_link_to_grove_portal_credentials). + +::: + +:::info 🔑 Grove Portal Credentials + +A Grove Portal Application ID and API Key are required to run load tests against the Grove Portal. If you do not have these, you can get them by visiting the [Grove Portal](https://www.portal.grove.city). + +::: + +1. **Setup credentials** + +```bash +make copy_e2e_load_test_config +``` + +You will be prompted to enter your Grove Portal Application ID and API Key. + +2. **Run load tests against Grove Portal** + +```bash +# Shannon load tests with specified service IDs only +make load_test eth,anvil + +# Shannon load tests with all service IDs +make load_test_all +``` \ No newline at end of file diff --git a/docusaurus/docs/develop/path/5_deep_dive_e2e_tests.md b/docusaurus/docs/develop/path/5_deep_dive_e2e_tests.md new file mode 100644 index 000000000..0ecfd1782 --- /dev/null +++ b/docusaurus/docs/develop/path/5_deep_dive_e2e_tests.md @@ -0,0 +1,168 @@ +--- +sidebar_position: 5 +title: Deep Dive - E2E Tests +description: Deep dive into End-to-End Tests for PATH +--- + +# Deep Dive: E2E Tests + + + +## Overview + +**The E2E tests verify:** + +- Correct request routing +- Service responses (data + latency) +- System reliability under load +- Success metrics for Shannon protocol + +**We use the [Vegeta library](https://github.com/tsenart/vegeta) for HTTP load testing:** + +- Can generate thousands of requests/sec +- Collects detailed metrics including latency percentiles (p50, p95, p99) +- Supports custom configurations and attack parameters +- Validates JSON-RPC responses and success rates + +
+![Vegeta](../../../static/img/9000.png) +
+ +## E2E Test Mode + +PATH E2E tests run in a single mode: + +| Mode | Make Targets | Purpose | How it Works | Use Cases | +| ------------- | --------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| **E2E Test** | `make e2e_test` | Full end-to-end testing that starts PATH in an isolated Docker container | 1. Spins up PATH in a Docker container using Dockertest
2. Uses protocol config (`.shannon.config.yaml`)
3. Runs tests
4. Tears down container | - Full system validation
- Continuous integration
- Regression testing | + +## E2E Test Config Files + +E2E Test mode requires protocol-specific configuration because it spins up a local PATH instance. + +| Configuration File | E2E Test (Required?) | Default available? | +| -------------------------------------------------- | :------------------: | :-----------------------------------------: | +| `./e2e/config/.shannon.config.yaml` (for Shannon) | ✅ | ❌ | +| `./e2e/config/.e2e_load_test.config.yaml` (custom) | ❌ | `e2e/config/e2e_load_test.config.tmpl.yaml` | + +:::tip Populate Configs + +You can use the following command to copy example configs and follow the instructions in your CLI: + +For E2E tests: + +- `make shannon_prepare_e2e_config` + +::: + +## Schema and Validation + +The configuration uses a formal YAML schema with validation: + +**Schema Location**: `./e2e/config/e2e_load_test.config.schema.yaml` + +:::tip VSCode Validation + +If you are using VSCode, we recommend using the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension for in-editor validation of the `.config.yaml` file. + +Enable it by ensuring the following annotation is present at the top of your config file: + +```yaml +# yaml-language-server: $schema=https://raw.githubusercontent.com/buildwithgrove/path/refs/heads/main/e2e/config/e2e_load_test.config.schema.yaml +``` + +::: + +## Supported Services in E2E Tests + +**All currently supported Grove Portal services are supported in the E2E tests.** + +:::tip + +To see the list of supported services for the tests, see the `test_cases` array in the [E2E Test Config](https://github.com/buildwithgrove/path/blob/main/e2e/config/e2e_load_test.config.tmpl.yaml) file. + +::: + +## Environment Variables + +These environment variables are set by the test make targets, but if you wish to set them manually, see the table below: + +
+Env Vars Table +| Variable | Description | Values | Required | +| ---------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------- | -------- | +| TEST_MODE | Determines the test execution mode | `e2e` | Yes | +| TEST_PROTOCOL | Specifies which protocol to test | `shannon` | Yes | +| TEST_SERVICE_IDS | Specifies which service IDs to test. If not set, all service IDs for the protocol will be tested. | Comma-separated list of service IDs | No | +
+ +## Extending/Updating/Adding EVM E2E Tests + +To add new services or methods to the E2E tests, you will need to open a new PR to PATH's `main` branch. + +1. **Add new service definitions** to the `services` array in the `e2e/config/services_shannon.yaml` configuration file +2. **Configure service parameters** including contract addresses, start blocks, and transaction hashes for archival tests + +**Example new service configuration:** + +_`./config/services_shannon.yaml`_ + +```yaml +services: + - name: "New Chain E2E Test" + protocol: "shannon" + service_id: "newchain" + archival: true + service_params: + contract_address: "0x..." + contract_start_block: 1000000 + transaction_hash: "0x..." + call_data: "0x18160ddd" +``` + +## Test Metrics and Validation + +The E2E tests collect and validate comprehensive metrics across multiple dimensions: + +| **Category** | **Metrics Collected** | +| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **HTTP Metrics** | - Success rates (HTTP 200)
- Status code distribution
- HTTP error categorization | +| **Latency Metrics** | - P50, P95, P99 latency percentiles
- Average latency
- Per-method latency analysis | +| **JSON-RPC Validation** | - Response unmarshaling success
- JSON-RPC error field validation
- Result field validation
- Protocol-specific validation | +| **Service-Level Metrics** | - Per-service success aggregation
- Cross-method performance comparison
- Service reliability scoring
- Error categorization and reporting | + +:::important Threshold Validation + +Tests will **fail** if any configured thresholds are exceeded, ensuring consistent service quality and performance. + +::: + +## Reviewing PATH Logs + +In E2E test mode, logs may be written to `./path_log_e2e_test_{timestamp}.txt`. + +**In order to enable this, set the log_to_file field:** + +```bash +yq eval '.e2e_load_test_config.e2e_config.docker_config.log_to_file = true' -i ./e2e/config/.e2e_load_test.config.yaml +``` + +You should see the following log line at the bottom of the test summary: + +```bash +===== 👀 LOGS 👀 ===== + + ✍️ PATH container output logged to /tmp/path_log_e2e_test_1745527319.txt ✍️ + +===== 👀 LOGS 👀 ===== + +``` + +## Debugging Anvil on Shannon Beta TestNet + +🌿 Grove Employees Only + +Review the [Anvil Shannon Beta TestNet Debugging Playbook](https://www.notion.so/buildwithgrove/Playbook-Debugging-Anvil-E2E-on-Beta-TestNet-177a36edfff6809c9f24e865ec5adbf8?pvs=4) if you believe the Anvil Supplier is broken. diff --git a/docusaurus/docs/develop/path/6_deep_dive_load_tests.md b/docusaurus/docs/develop/path/6_deep_dive_load_tests.md new file mode 100644 index 000000000..bbfcad61e --- /dev/null +++ b/docusaurus/docs/develop/path/6_deep_dive_load_tests.md @@ -0,0 +1,141 @@ +--- +sidebar_position: 6 +title: Deep Dive - Load Tests +description: Deep dive into Load Tests for PATH +--- + +# Deep Dive: Load Tests + +## Overview + +**Goal of this document**: Load testing to verify PATH works and scales under load. + +**The load tests verify:** + +- Service responses under load (data + latency) +- System reliability and performance +- Success metrics for Shannon protocol +- Scalability characteristics + +**We use the [Vegeta library](https://github.com/tsenart/vegeta) for HTTP load testing:** + +- Can generate thousands of requests/sec +- Collects detailed metrics including latency percentiles (p50, p95, p99) +- Supports custom configurations and attack parameters +- Validates JSON-RPC responses and success rates + +
+![Vegeta](../../../static/img/9000.png) +
+ +## Load Test Modes + +PATH load tests support two distinct modes of operation: + +| Mode | Purpose | How it Works | Use Cases | +| ----------------------- | ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| **Local PATH** | Performance testing against local PATH instances | 1. Requires completed [Quick Start](1_quick_start.md) and [Shannon Cheat Sheet](2_cheatsheet_shannon.md) setup
2. Tests against local PATH instance | - Local development testing
- Feature validation
- Development iteration | +| **Grove Portal** | Performance testing against Grove Portal | 1. Sends requests to Grove Portal gateway URL
2. Requires Grove Portal credentials or pre-configured files | - Testing production gateway
- Production performance validation
- Benchmarking | + +### Local PATH Mode + +For local PATH load testing, you need: + +1. **Completed Setup**: Follow the [Quick Start](1_quick_start.md) and [Shannon Cheat Sheet](2_cheatsheet_shannon.md) guides +2. **Local PATH Instance**: Your local PATH instance should be running and configured +3. **Default Configuration**: The system automatically targets your local PATH instance + +### Grove Portal Mode + +You will need one of the following: + +1. **Grove Employee Pre-configured Files** + - Download from 1Password links above + - Copy to `e2e/config/.grove.e2e_load_test.config.yaml` + +2. **Custom Portal Access** + - `gateway_url_override`: `https://rpc.grove.city/v1` + - Get credentials from the [Grove Portal](https://www.portal.grove.city) + - Use `make copy_e2e_load_test_config` to set up + +## Load Test Configuration + +**Configuration files used:** + +| Configuration File | Local PATH | Grove Portal | Default Available? | +| -------------------------------------------------- | :--------: | :----------: | :-----------------------------------------: | +| `./e2e/config/.grove.e2e_load_test.config.yaml` | ❌ | ✅ | ❌ | +| `./e2e/config/.e2e_load_test.config.yaml` | ✅ | ✅ | `e2e/config/e2e_load_test.config.tmpl.yaml` | + +:::tip Populate Configs + +You can use the following command to copy example configs and follow the instructions in your CLI: + +- `make copy_e2e_load_test_config` + +::: + +## Schema and Validation + +The configuration uses a formal YAML schema with validation: + +**Schema Location**: `./e2e/config/e2e_load_test.config.schema.yaml` + +:::tip VSCode Validation + +If you are using VSCode, we recommend using the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension for in-editor validation of the `.config.yaml` file. + +Enable it by ensuring the following annotation is present at the top of your config file: + +```yaml +# yaml-language-server: $schema=https://raw.githubusercontent.com/buildwithgrove/path/refs/heads/main/e2e/config/e2e_load_test.config.schema.yaml +``` + +::: + +## Supported Services in Load Tests + +**All currently supported Grove Portal services are supported in the load tests.** + +:::tip + +To see the list of supported services for the tests, see the `test_cases` array in the [Load Test Config](https://github.com/buildwithgrove/path/blob/main/e2e/config/e2e_load_test.config.tmpl.yaml) file. + +::: + +## Test Metrics and Validation + +The load tests collect and validate comprehensive metrics across multiple dimensions: + +| **Category** | **Metrics Collected** | +| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| **HTTP Metrics** | - Success rates (HTTP 200)
- Status code distribution
- HTTP error categorization | +| **Latency Metrics** | - P50, P95, P99 latency percentiles
- Average latency
- Per-method latency analysis | +| **JSON-RPC Validation** | - Response unmarshaling success
- JSON-RPC error field validation
- Result field validation
- Protocol-specific validation | +| **Service-Level Metrics** | - Per-service success aggregation
- Cross-method performance comparison
- Service reliability scoring
- Error categorization and reporting | + +:::important Threshold Validation + +Tests will **fail** if any configured thresholds are exceeded, ensuring consistent service quality and performance. + +::: + +## Reviewing PATH Logs + +When running against local PATH instances, logs may be written to `./path_log_load_test_{timestamp}.txt`. + +**In order to enable this, set the log_to_file field:** + +```bash +yq eval '.e2e_load_test_config.load_test_config.log_to_file = true' -i ./e2e/config/.e2e_load_test.config.yaml +``` + +You should see the following log line at the bottom of the test summary: + +```bash +===== 👀 LOGS 👀 ===== + + ✍️ PATH container output logged to /tmp/path_log_load_test_1745527319.txt ✍️ + +===== 👀 LOGS 👀 ===== +``` diff --git a/docusaurus/docs/develop/path/7_deep_dive_develop_env.md b/docusaurus/docs/develop/path/7_deep_dive_develop_env.md new file mode 100644 index 000000000..6c174373f --- /dev/null +++ b/docusaurus/docs/develop/path/7_deep_dive_develop_env.md @@ -0,0 +1,41 @@ +--- +sidebar_position: 7 +title: Deep Dive - Local Development Environment +description: Technical details and background information +--- + +# Developer Deep Dive + +Technical details for developers who want to understand PATH's development environment. + +## Development Environment Architecture + +**PATH**'s development mode uses a Kubernetes-based local development environment with [Tilt](https://tilt.dev/). + +We use [Kind](https://kind.sigs.k8s.io/) (Kubernetes in Docker) for running the local Kubernetes cluster, as it provides better compatibility with Tilt's image building process compared to Docker Desktop's Kubernetes cluster. + +## Installed Tools + +**Tools installed by `make install_tools`**: +- [**pocketd CLI**](https://dev.poktroll.com/category/pocketd-cli): CLI for interacting with Pocket Network's Shannon protocol +- [**Docker**](https://docs.docker.com/get-docker/): Container runtime +- [**Kind**](https://kind.sigs.k8s.io/#installation-and-usage): Local Kubernetes cluster +- [**kubectl**](https://kubernetes.io/docs/tasks/tools/#kubectl): CLI for interacting with Kubernetes +- [**Helm**](https://helm.sh/docs/intro/install/): Package manager for Kubernetes +- [**Tilt**](https://docs.tilt.dev/install.html): Local Kubernetes development environment + +**Optional development tools** (`make install_optional_tools`): +- [**Relay Util**](https://github.com/commoddity/relay-util): Load testing tool for sending configurable batches of relays concurrently +- [**Graphviz**](https://graphviz.org): Required for generating profiling & debugging performance +- [**Uber Mockgen**](https://github.com/uber-go/mock): Mock interface generator for testing + +## Protocol Support + +| Protocol | Status (04/2025) | Documentation | +| -------- | ---------------------- | ------------------------------------------------- | +| Shannon | Beta & Private MainNet | [Shannon Protocol Guide](3_cheatsheet_shannon.md) | +| Morse | MainNet (deprecated) | [Morse Protocol Guide](4_cheatsheet_morse.md) | + +## Architecture Overview + +*This section will be expanded as more technical details are moved from other documentation files.* diff --git a/docusaurus/docs/develop/path/7_e2e_and_load_tests.md b/docusaurus/docs/develop/path/7_e2e_and_load_tests.md deleted file mode 100644 index 45598ad2e..000000000 --- a/docusaurus/docs/develop/path/7_e2e_and_load_tests.md +++ /dev/null @@ -1,285 +0,0 @@ ---- -sidebar_position: 7 -title: E2E & Load Tests -description: End-to-End & Load Tests for PATH ---- - -**Goal of this document**: Fully featured E2E & Load Tets to verify PATH works and scales. - -
-![E2E Test](../../../static/img/e2e_test.gif) -
- -## Table of Contents - -- [tl;dr How do I run the tests?](#tldr-how-do-i-run-the-tests) - - [1. **Run E2E tests**](#1-run-e2e-tests) - - [2. **Run load tests**](#2-run-load-tests) -- [Overview](#overview) -- [E2E \& Load Test Modes](#e2e--load-test-modes) - - [E2E Test Config Files](#e2e-test-config-files) - - [Load Test Mode Configuration](#load-test-mode-configuration) - - [Schema and Validation](#schema-and-validation) - - [Supported Services in E2E Tests](#supported-services-in-e2e-tests) - - [Environment Variables](#environment-variables) - - [Extending/Updating/Adding EVM E2E Tests](#extendingupdatingadding-evm-e2e-tests) - - [Test Metrics and Validation](#test-metrics-and-validation) -- [Troubleshooting](#troubleshooting) - - [Running Binary manually (no docker)](#running-binary-manually-no-docker) - - [Reviewing PATH Logs](#reviewing-path-logs) - - [Debugging Anvil on Shannon Beta TestNet](#debugging-anvil-on-shannon-beta-testnet) - -## tl;dr How do I run the tests? - -### 1. **Run E2E tests** - -```bash -# Shannon E2E tests with all service IDs -make e2e_test_all - -# Shannon E2E tests with specified service IDs only -make e2e_test eth,anvil - -# Morse E2E tests with all service IDs -make morse_e2e_test_all - -# Morse E2E tests with specified service IDs only -make morse_e2e_test F00C,F021 -``` - -### 2. **Run load tests** - -:::info 🔑 Grove Portal Credentials - -A Grove Portal Application ID and API Key are required to run load tests against the Grove Portal. - -Run `make copy_e2e_load_test_config` to copy and populate the load test config file with your Portal credentials. - -You will be prompted to enter your Grove Portal Application ID and API Key. If you do not have these, you can get them by visiting the [Grove Portal](https://www.portal.grove.city). - -::: - -```bash -# Shannon load tests with all service IDs -make load_test_all - -# Shannon load tests with specified service IDs only -make load_test eth,anvil - -# Morse load tests with all service IDs -make morse_load_test_all - -# Morse load tests with specified service IDs only -make morse_load_test F00C,F021 -``` - -## Overview - -**The E2E tests verify:** - -- Correct request routing -- Service responses (data + latency) -- System reliability under load -- Success metrics across different protocols (Morse & Shannon) - -**We use the [Vegeta library](https://github.com/tsenart/vegeta) for HTTP load testing:** - -- Can generate thousands of requests/sec -- Collects detailed metrics including latency percentiles (p50, p95, p99) -- Supports custom configurations and attack parameters -- Validates JSON-RPC responses and success rates - -
-![Vegeta](../../../static/img/9000.png) -
- -## E2E & Load Test Modes - -PATH E2E tests support two distinct modes of operation: - -| Mode | Make Targets | Purpose | How it Works | Use Cases | -| ------------- | --------------------------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -| **E2E Test** | `make e2e_test`
`make morse_e2e_test` | Full end-to-end testing that starts PATH in an isolated Docker container | 1. Spins up PATH in a Docker container using Dockertest
2. Uses protocol config (`.morse.config.yaml` or `.shannon.config.yaml`)
3. Runs tests
4. Tears down container | - Full system validation
- Continuous integration
- Regression testing | -| **Load Test** | `make load_test`
`make morse_load_test` | Performance testing against existing PATH instances | 1. Sends requests to a provided gateway URL (local or remote)
2. No Docker container setup required | - Testing production gateway
- Testing local PATH instances | - -### E2E Test Config Files - -**There are a few types of configs:** - -- E2E Test mode requires protocol-specific configuration because it spins up a local PATH instance. -- Load Test mode targets an external or local PATH instance, so protocol configs are not needed. - -| Configuration File | E2E Test (Required?) | Load Test (Required?) | Default available? | -| -------------------------------------------------- | :------------------: | :-------------------: | :-----------------------------------------: | -| `./e2e/config/.morse.config.yaml` (for Morse) | ✅ | ❌ | ❌ | -| `./e2e/config/.shannon.config.yaml` (for Shannon) | ✅ | ❌ | ❌ | -| `./e2e/config/.e2e_load_test.config.yaml` (custom) | ❌ | ✅ | `e2e/config/e2e_load_test.config.tmpl.yaml` | - -:::tip Populate Configs - -You can use the following commands to copy example configs and follow the instructions in your CLI: - -For E2E tests: - -- `make morse_prepare_e2e_config` -- `make shannon_prepare_e2e_config` - -For Load tests: - -- `make copy_e2e_load_test_config` - -::: - -### Load Test Mode Configuration - -You will need one of the following: - -1. **Portal Access** - - - `gateway_url_override`: `https://rpc.grove.city/v1` - - Get credentials from the [Grove Portal](https://www.portal.grove.city) - -2. **Local PATH Instance** - - - `gateway_url_override`: `http://localhost:3069/v1` - - Run `make path_run` in another shell to start PATH - -### Schema and Validation - -The configuration uses a formal YAML schema with validation: - -**Schema Location**: `./e2e/config/e2e_load_test.config.schema.yaml` - -:::tip VSCode Validation - -If you are using VSCode, we recommend using the [YAML Language Support](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) extension for in-editor validation of the `.config.yaml` file. - -Enable it by ensuring the following annotation is present at the top of your config file: - -```yaml -# yaml-language-server: $schema=https://raw.githubusercontent.com/buildwithgrove/path/refs/heads/main/e2e/config/e2e_load_test.config.schema.yaml -``` - -::: - ---- - -### Supported Services in E2E Tests - -**All currently supported Grove Portal services are supported in the E2E & Load tests.** - -:::tip - -To see the list of supported services for the tests, see the `test_cases` array in the [E2E & Load Test Config](https://github.com/buildwithgrove/path/blob/main/e2e/config/e2e_load_test.config.tmpl.yaml) file. - -::: - -### Environment Variables - -These environment variables are set by the test make targets, but if you wish to set them manually, see the table below: - -
-Env Vars Table -| Variable | Description | Values | Required | -| ---------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------- | -------- | -| TEST_MODE | Determines the test execution mode | `e2e`, `load` | Yes | -| TEST_PROTOCOL | Specifies which protocol to test | `morse`, `shannon` | Yes | -| TEST_SERVICE_IDS | Specifies which service IDs to test. If not set, all service IDs for the protocol will be tested. | Comma-separated list of service IDs | No | -
- -### Extending/Updating/Adding EVM E2E Tests - -To add new services or methods to the E2E tests, you will need to open a new PR to PATH's `main` branch. - -1. **Add new service definitions** to the `services` array in the `e2e/config/services_shannon.yaml` or `e2e/config/services_morse.yaml` configuration file -2. **Configure service parameters** including contract addresses, start blocks, and transaction hashes for archival tests - -**Example new service configuration:** - -_`./config/services_morse.yaml`_ - -```yaml -services: - - name: "New Chain Load Test" - protocol: "morse" - service_id: "FNEW" - archival: true - service_params: - contract_address: "0x..." - contract_start_block: 1000000 - transaction_hash: "0x..." - call_data: "0x18160ddd" -``` - -### Test Metrics and Validation - -The E2E tests collect and validate comprehensive metrics across multiple dimensions: - -| **Category** | **Metrics Collected** | -| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| **HTTP Metrics** | - Success rates (HTTP 200)
- Status code distribution
- HTTP error categorization | -| **Latency Metrics** | - P50, P95, P99 latency percentiles
- Average latency
- Per-method latency analysis | -| **JSON-RPC Validation** | - Response unmarshaling success
- JSON-RPC error field validation
- Result field validation
- Protocol-specific validation | -| **Service-Level Metrics** | - Per-service success aggregation
- Cross-method performance comparison
- Service reliability scoring
- Error categorization and reporting | - -:::important Threshold Validation - -Tests will **fail** if any configured thresholds are exceeded, ensuring consistent service quality and performance. - -::: - -## Troubleshooting - -### Running Binary manually (no docker) - -Load tests may also be run against a local PATH instance. - -**To enable this, first set the gateway URL override:** - -```bash -yq eval '.e2e_load_test_config.load_test_config.gateway_url_override = "http://localhost:3069/v1"' -i ./e2e/config/.e2e_load_test.config.yaml -``` - -**Then, in one shell, run:** - -```bash -# Replace with .morse.config.yaml for Morse -cp ./e2e/config/.shannon.config.yaml ./local/path/.config.yaml -make path_run -``` - -**Once the PATH instance is running, in another shell, run one of the following:** - -_Assuming you have configured PATH for the `eth` service ID on the `shannon` protocol._ - -```bash -# Shannon load test for `eth` service ID -make load_test eth -``` - -### Reviewing PATH Logs - -In E2E test mode, logs may be written to `./path_log_e2e_test_{timestamp}.txt`. - -**In order to enable this, set the log_to_file field:** - -```bash -yq eval '.e2e_load_test_config.e2e_config.docker_config.log_to_file = true' -i ./e2e/config/.e2e_load_test.config.yaml -``` - -You should see the following log line at the bottom of the test summary: - -```bash -===== 👀 LOGS 👀 ===== - - ✍️ PATH container output logged to /tmp/path_log_e2e_test_1745527319.txt ✍️ - -===== 👀 LOGS 👀 ===== - -``` - -### Debugging Anvil on Shannon Beta TestNet - -🌿 Grove Employees Only - -Review the [Anvil Shannon Beta TestNet Debugging Playbook](https://www.notion.so/buildwithgrove/Playbook-Debugging-Anvil-E2E-on-Beta-TestNet-177a36edfff6809c9f24e865ec5adbf8?pvs=4) if you believe the Anvil Supplier is broken. diff --git a/docusaurus/docs/develop/path/5_configurations_path.md b/docusaurus/docs/develop/path/8_ref_configurations_path.md similarity index 99% rename from docusaurus/docs/develop/path/5_configurations_path.md rename to docusaurus/docs/develop/path/8_ref_configurations_path.md index b7b1adbbc..1a13701de 100644 --- a/docusaurus/docs/develop/path/5_configurations_path.md +++ b/docusaurus/docs/develop/path/8_ref_configurations_path.md @@ -1,6 +1,6 @@ --- -sidebar_position: 5 -title: PATH Config File (`.config.yaml`) +sidebar_position: 8 +title: Reference - PATH Config File (`.config.yaml`) description: PATH Configurations --- diff --git a/docusaurus/docs/develop/path/6_configurations_helm.md b/docusaurus/docs/develop/path/9_ref_configurations_helm.md similarity index 98% rename from docusaurus/docs/develop/path/6_configurations_helm.md rename to docusaurus/docs/develop/path/9_ref_configurations_helm.md index 94ae6dfbf..5570002d3 100644 --- a/docusaurus/docs/develop/path/6_configurations_helm.md +++ b/docusaurus/docs/develop/path/9_ref_configurations_helm.md @@ -1,6 +1,6 @@ --- -sidebar_position: 6 -title: PATH Helm Config (`.values.yaml`) +sidebar_position: 9 +title: Reference - PATH Helm Config (`.values.yaml`) description: PATH Helm Configurations --- diff --git a/e2e/config/e2e_load_test.config.tmpl.yaml b/e2e/config/e2e_load_test.config.tmpl.yaml index 49d61826b..3e9542ee5 100644 --- a/e2e/config/e2e_load_test.config.tmpl.yaml +++ b/e2e/config/e2e_load_test.config.tmpl.yaml @@ -1,5 +1,7 @@ # yaml-language-server: $schema=./e2e_load_test.config.schema.yaml +# TODO_TECHDEBT(@adshmh): Simplify/delete other E2E/Load Testing config files. +# # Default Load test configuration for Morse and Shannon # # Usage: @@ -11,21 +13,7 @@ # 1. E2E Test Mode: Starts PATH in Docker (Dockertest) & runs tests against it # 2. Load Test Mode: Runs tests against a specified gateway URL -# General test configuration overrides for all tests e2e_load_test_config: - # E2E Test Mode - # PATH runs in Docker (Dockertest), tests run against this container - e2e_config: - # [Optional] Seconds to wait for hydrator checks after PATH startup - wait_for_hydrator: 0 - # [Optional] Docker-related options - docker_config: - # [Optional] Log Docker container output to a file - log_to_file: false - # [Optional] Force Docker image rebuild (useful after code changes) - force_rebuild_image: false - - # Load Test Mode # Tests run against a specified gateway URL (local or public) # Examples: # - Public: "https://rpc.grove.city/v1" @@ -33,51 +21,132 @@ e2e_load_test_config: load_test_config: # [Required] Custom PATH gateway URL # - # The default value uses the Grove Portal as the gateway URL. - # - # To test against a local PATH instance, use the following URL instead: - # gateway_url_override: "http://localhost:3069/v1" - gateway_url_override: "https://rpc.grove.city/v1" - - # [Optional] Custom user identifier for the test (i.e. portal-application-id) - # - # DEV_NOTE: This field IS required if you are testing against the Grove Portal. + # The default value uses the Local PATH. # - # If you do not have a Grove Portal Application ID, get one by visiting: - # https://www.portal.grove.city + # To test against the Grove Portal, follow the instructions in following URL: + # path.grove.city/develop/path/load_tests#load-testing-the-grove-portal # - # This field is NOT required if you are testing against a local PATH instance. - portal_application_id: "" - - # [Optional] Custom API key for the test (i.e. portal-api-key) - # - # DEV_NOTE: This field IS required if your Grove Portal Application ID - # requires an API key to be set in the `Authorization` header. - # - # This field is NOT required if you are testing against a local PATH instance. - portal_api_key: "" + gateway_url_override: "http://localhost:3070/v1" + portal_api_key: "test_api_key" + portal_application_id: "test" # Default configuration applied to all test cases (unless overridden) default_service_config: - global_rps: 50 # Requests per second (shared across all methods) - requests_per_method: 50 # Number of requests per method - success_rate: 0.80 # Minimum required success rate (80%) - max_p50_latency_ms: 2000ms # Max allowed P50 latency (ms) - max_p95_latency_ms: 5000ms # Max allowed P95 latency (ms) - max_p99_latency_ms: 10000ms # Max allowed P99 latency (ms) + global_rps: 100 # Requests per second (shared across all methods) + requests_per_method: 300 # Number of requests per method + success_rate: 0.95 # Minimum required success rate (80%) + max_p50_latency_ms: 10000ms # Max allowed P50 latency (ms) + max_p95_latency_ms: 20000ms # Max allowed P95 latency (ms) + max_p99_latency_ms: 30000ms # Max allowed P99 latency (ms) # Override default configuration for specific services service_config_overrides: - # Shannon - Ethereum Mainnet (Archival) - # "eth" is not yet fully supplied so may require higher latency thresholds - "eth": - max_p50_latency_ms: 4000ms - max_p95_latency_ms: 8000ms - max_p99_latency_ms: 12000ms - # Base - Base Mainnet (Archival) - # "base" is not yet fully supplied so may require higher latency thresholds + "anvil": + global_rps: 1 + requests_per_method: 3 + "arb_one": + archival: true + "arb_sep_test": + archival: true + "avax": + archival: true + "avax-dfk": + archival: true "base": - archival: false - max_p50_latency_ms: 4000ms - max_p95_latency_ms: 8000ms - max_p99_latency_ms: 12000ms + archival: true + "base-test": + archival: true + "bera": + archival: true + "bitcoin": + archival: true + "blast": + archival: true + "boba": + archival: true + "bsc": + archival: true + "celo": + archival: true + "eth": + archival: true + "eth_hol_test": + archival: true + "eth_sep_test": + archival: true + "evmos": + archival: true + "fantom": + archival: true + "fraxtal": + archival: true + "fuse": + archival: true + "gnosis": + archival: true + "harmony": + archival: true + "ink": + archival: true + "iotex": + archival: true + "kaia": + archival: true + "kava": + archival: true + "linea": + archival: true + "mantle": + archival: true + "metis": + archival: true + "moonbeam": + archival: true + "moonriver": + archival: true + "near": + archival: true + "oasys": + archival: true + "op": + archival: true + "op_sep_test": + archival: true + "opbnb": + archival: true + "osmosis": + archival: true + "pocket": + archival: true + "poly": + archival: true + "poly_amoy_test": + archival: true + "poly_zkevm": + archival: true + "radix": + archival: true + "scroll": + archival: true + "sei": + archival: true + "solana": + archival: true + "sonic": + archival: true + "sui": + archival: true + "taiko": + archival: true + "taiko_hek_test": + archival: true + "tron": + archival: true + "xrpl_evm_dev": + archival: true + "xrpl_evm_test": + archival: true + "zklink_nova": + archival: true + "zksync_era": + archival: true diff --git a/local/scripts/install_tools.sh b/local/scripts/install_tools.sh old mode 100755 new mode 100644 index 2c775cf7d..58298a38c --- a/local/scripts/install_tools.sh +++ b/local/scripts/install_tools.sh @@ -4,7 +4,7 @@ # This will greatly simplify the developer experience of running PATH in development mode and remove the need to have a # local Kubernetes cluster running, as well as the need to install these tools on the host machine. -# This script installs Docker, Kind, Kubectl, Helm, and Tilt if they are not already installed. +# This script installs Docker, Kind, Kubectl, Helm, Tilt, and pocketd if they are not already installed. # It detects the OS and architecture to download the correct binaries. set -e @@ -201,6 +201,26 @@ install_tilt() { tilt version } +# Function to install pocketd (always install to ensure latest version) +install_pocketd() { + if command_exists pocketd; then + log "WARNING" "🌟 pocketd already installed. Overwriting with latest version..." + pocketd version + else + log "INFO" "🌟 Installing pocketd..." + fi + + # Run the official pocketd installation script + curl -sSL https://raw.githubusercontent.com/pokt-network/poktroll/main/tools/scripts/pocketd-install.sh | bash -s -- --upgrade + + if command_exists pocketd; then + log "SUCCESS" "✅ pocketd installed successfully." + pocketd version + else + log "WARNING" "pocketd installation completed but pocketd command not found. You may need to restart your terminal or update your PATH." + fi +} + # Function to prompt user for confirmation prompt_user() { local message="$1" @@ -221,10 +241,10 @@ log "INFO" "🔍 Starting installation script..." # Detect system architecture and OS detect_system -# Check for missing dependencies +# Check for missing dependencies (pocketd is always installed) MISSING_DEPS=() -for cmd in docker kind kubectl helm tilt; do +for cmd in docker kind kubectl helm tilt pocketd; do if ! command_exists "$cmd"; then case "$cmd" in docker) MISSING_DEPS+=("🐳 Docker: Container engine for running applications in containers") ;; @@ -236,19 +256,33 @@ for cmd in docker kind kubectl helm tilt; do fi done +# Always check pocketd status for user information +if command_exists pocketd; then + POCKETD_STATUS="🌟 pocketd: Pocket Network Protocol daemon (will be updated to latest version)" +else + POCKETD_STATUS="🌟 pocketd: Pocket Network Protocol daemon (will be installed)" +fi + if [ ${#MISSING_DEPS[@]} -eq 0 ]; then - log "SUCCESS" "✅ All dependencies are installed." - exit 0 + log "SUCCESS" "✅ All core dependencies are installed." + log "INFO" "$POCKETD_STATUS" +else + # Display missing dependencies + log "WARNING" "🚨 The following required dependencies are missing:" + for dep in "${MISSING_DEPS[@]}"; do + echo -e "${YELLOW}${dep}${RESET}" + done + log "INFO" "$POCKETD_STATUS" fi -# Display missing dependencies -log "WARNING" "🚨 The following required dependencies are missing:" -for dep in "${MISSING_DEPS[@]}"; do - echo -e "${YELLOW}${dep}${RESET}" -done +# Always prompt for installation if there are missing deps OR for pocketd update +if [ ${#MISSING_DEPS[@]} -gt 0 ]; then + PROMPT_MESSAGE="❔ Would you like to install the missing dependencies and update pocketd? (y/n):" +else + PROMPT_MESSAGE="❔ Would you like to update pocketd to the latest version? (y/n):" +fi -# Prompt user to install -if ! prompt_user "❔ Would you like to install these dependencies? (y/n):"; then +if ! prompt_user "$PROMPT_MESSAGE"; then log "WARNING" "Installation aborted by user" exit 1 fi @@ -259,5 +293,6 @@ install_kind install_kubectl install_helm install_tilt +install_pocketd log "SUCCESS" "✅ Installation script completed." diff --git a/makefiles/deps.mk b/makefiles/deps.mk index 2bea726b6..b26af04bc 100644 --- a/makefiles/deps.mk +++ b/makefiles/deps.mk @@ -3,9 +3,9 @@ ############################### .PHONY: install_tools -install_tools: ## Checks for missing local development tools and installs them to start a PATH instance in Tilt (Docker, Kind, kubectl, Helm, Tilt) +install_tools: ## Checks for missing local development tools and installs them to start a PATH instance in Tilt (Docker, Kind, kubectl, Helm, Tilt, pocketd) ./local/scripts/install_tools.sh .PHONY: install_optional_tools install_optional_tools: ## Checks for and installs optional local development tools (Relay Util, Graphviz, Mockgen) - ./local/scripts/install_optional_tools.sh + ./local/scripts/install_optional_tools.sh \ No newline at end of file From b59d21bf62641417ab6fe2f4098bea2d8391079e Mon Sep 17 00:00:00 2001 From: Arash Deshmeh Date: Mon, 23 Jun 2025 18:16:53 -0400 Subject: [PATCH 3/9] Fix install_tools.sh permissions --- local/scripts/install_tools.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 local/scripts/install_tools.sh diff --git a/local/scripts/install_tools.sh b/local/scripts/install_tools.sh old mode 100644 new mode 100755 From d4f13ed6dc82efa0050f0b69d59d70ceddbdea81 Mon Sep 17 00:00:00 2001 From: Arash Deshmeh Date: Mon, 23 Jun 2025 18:59:34 -0400 Subject: [PATCH 4/9] Fix 1Password link for Grove Portal credentials --- docusaurus/docs/develop/path/4_load_tests.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docusaurus/docs/develop/path/4_load_tests.md b/docusaurus/docs/develop/path/4_load_tests.md index bf0b9163d..4612e5144 100644 --- a/docusaurus/docs/develop/path/4_load_tests.md +++ b/docusaurus/docs/develop/path/4_load_tests.md @@ -37,7 +37,7 @@ The remainder of this document is only relevant if you intend to load test the G :::info 🏢 **Grove Employees** -You can obtain the required Portal Application ID and API Key from the [1Password link](1Password_link_to_grove_portal_credentials). +You can obtain the required Portal Application ID and API Key from the [Grove Portal App Credentials for PATH Load Testing on 1Password](https://start.1password.com/open/i?a=4PU7ZENUCRCRTNSQWQ7PWCV2RM&v=kudw25ob4zcynmzmv2gv4qpkuq&i=iznzvqegxbl4y73d5lppm4y6r4&h=buildwithgrove.1password.com). ::: @@ -63,4 +63,4 @@ make load_test eth,anvil # Shannon load tests with all service IDs make load_test_all -``` \ No newline at end of file +``` From fd156a1a11c6234ddfcbd41e6c2bcc71b14e7740 Mon Sep 17 00:00:00 2001 From: Arash Deshmeh Date: Mon, 23 Jun 2025 19:52:07 -0400 Subject: [PATCH 5/9] Fix pages links --- docusaurus/docs/README.md | 2 +- docusaurus/docs/develop/path/10_cheatsheet_morse.md | 4 ++-- docusaurus/docs/develop/path/1_quick_start.md | 2 +- docusaurus/docs/develop/path/2_cheatsheet_shannon.md | 6 +++--- docusaurus/docs/develop/path/7_deep_dive_develop_env.md | 4 ++-- docusaurus/docs/learn/qos/1_supported_services.md | 2 +- docusaurus/docs/learn/qos/3_adding_new_archival.md | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docusaurus/docs/README.md b/docusaurus/docs/README.md index 47c56f47d..18996584d 100644 --- a/docusaurus/docs/README.md +++ b/docusaurus/docs/README.md @@ -30,7 +30,7 @@ An easy way to think about **PATH** and **Pocket Network** is: ## Where do I get started? -To get started, allocate 1-3 hours of time and start with the [PATH Introduction](develop/path/1_introduction.md). +To get started, allocate 1-3 hours of time and start with the [PATH Quick Start](develop/path/1_quick_start.md). It will go through all the details of how PATH works, how to configure it, and how to run it locally. diff --git a/docusaurus/docs/develop/path/10_cheatsheet_morse.md b/docusaurus/docs/develop/path/10_cheatsheet_morse.md index 28c5ae924..0bdd5c13e 100644 --- a/docusaurus/docs/develop/path/10_cheatsheet_morse.md +++ b/docusaurus/docs/develop/path/10_cheatsheet_morse.md @@ -26,7 +26,7 @@ This guide covers setting up `PATH` with the **Morse** protocol. In MainNet as o ## 0. Prerequisites -1. Prepare your environment by following the instructions in the [**environment setup**](2_environment.md) guide. +1. Prepare your environment by following the instructions in the [**Quick Start**](1_quick_start.md) guide. 2. Install the [**pocket CLI**](https://github.com/pokt-network/homebrew-pocket-core): CLI for interacting with Pocket's Morse Network :::tip @@ -178,7 +178,7 @@ feature unless you are customizing QoS modules yourself. For more information, see: -- [PATH Configuration File](./5_configurations_path.md#hydrator_config-optional) +- [PATH Configuration File](./8_ref_configurations_path.md#hydrator_config-optional) - [Supported QoS Services](../../learn/qos/1_supported_services.md) :::tip diff --git a/docusaurus/docs/develop/path/1_quick_start.md b/docusaurus/docs/develop/path/1_quick_start.md index 349e1b460..b1534550b 100644 --- a/docusaurus/docs/develop/path/1_quick_start.md +++ b/docusaurus/docs/develop/path/1_quick_start.md @@ -37,4 +37,4 @@ make install_tools # What's Next -**[Shannon Cheat Sheet](3_cheatsheet_shannon.md)** - Configure PATH for the Shannon protocol \ No newline at end of file +**[Shannon Cheat Sheet](2_cheatsheet_shannon.md)** - Configure PATH for the Shannon protocol diff --git a/docusaurus/docs/develop/path/2_cheatsheet_shannon.md b/docusaurus/docs/develop/path/2_cheatsheet_shannon.md index 8400a66b7..722dd51c7 100644 --- a/docusaurus/docs/develop/path/2_cheatsheet_shannon.md +++ b/docusaurus/docs/develop/path/2_cheatsheet_shannon.md @@ -44,7 +44,7 @@ Coming from the [App & PATH Gateway Cheat Sheet](https://dev.poktroll.com/operat ## 0. Prerequisites -Complete the [**Quick Start**](1_getting_started.md) guide. +Complete the [**Quick Start**](1_quick_start.md) guide. ## 1. Setup Shannon Protocol Accounts (Gateway & Application) @@ -209,7 +209,7 @@ To disable for specific services, add `qos_disabled_service_ids` to `.config.yam **Use cases**: Testing and development. **More info**: -- [PATH Configuration File](./5_configurations_path.md#hydrator_config-optional) +- [PATH Configuration File](./8_ref_configurations_path.md#hydrator_config-optional) - [Supported QoS Services](../../learn/qos/1_supported_services.md) :::tip @@ -305,4 +305,4 @@ When you're finished testing and want to stop PATH: ```bash make path_down -``` \ No newline at end of file +``` diff --git a/docusaurus/docs/develop/path/7_deep_dive_develop_env.md b/docusaurus/docs/develop/path/7_deep_dive_develop_env.md index 6c174373f..c0e03a607 100644 --- a/docusaurus/docs/develop/path/7_deep_dive_develop_env.md +++ b/docusaurus/docs/develop/path/7_deep_dive_develop_env.md @@ -33,8 +33,8 @@ We use [Kind](https://kind.sigs.k8s.io/) (Kubernetes in Docker) for running the | Protocol | Status (04/2025) | Documentation | | -------- | ---------------------- | ------------------------------------------------- | -| Shannon | Beta & Private MainNet | [Shannon Protocol Guide](3_cheatsheet_shannon.md) | -| Morse | MainNet (deprecated) | [Morse Protocol Guide](4_cheatsheet_morse.md) | +| Shannon | Beta & Private MainNet | [Shannon Protocol Guide](2_cheatsheet_shannon.md) | +| Morse | MainNet (deprecated) | [Morse Protocol Guide](10_cheatsheet_morse.md) | ## Architecture Overview diff --git a/docusaurus/docs/learn/qos/1_supported_services.md b/docusaurus/docs/learn/qos/1_supported_services.md index 4126300d0..ffa17b35d 100644 --- a/docusaurus/docs/learn/qos/1_supported_services.md +++ b/docusaurus/docs/learn/qos/1_supported_services.md @@ -28,7 +28,7 @@ hydrator_config: - "F00C" ``` -See [PATH Configuration File](../../develop/path/5_configurations_path.md#hydrator_config-optional) for more details. +See [PATH Configuration File](../../develop/path/8_ref_configurations_path.md#hydrator_config-optional) for more details. ## ⛓️ Supported QoS Services diff --git a/docusaurus/docs/learn/qos/3_adding_new_archival.md b/docusaurus/docs/learn/qos/3_adding_new_archival.md index 9e064ceda..bc6830017 100644 --- a/docusaurus/docs/learn/qos/3_adding_new_archival.md +++ b/docusaurus/docs/learn/qos/3_adding_new_archival.md @@ -101,8 +101,8 @@ Configure PATH for the service you want to test, and run `make path_run` to star For information on how to configure PATH for a service, see one of the PATH cheatsheets: -- [Shannon Cheat Sheet](../../develop/path/3_cheatsheet_shannon.md) -- [Morse Cheat Sheet](../../develop/path/4_cheatsheet_morse.md) +- [Shannon Cheat Sheet](../../develop/path/2_cheatsheet_shannon.md) +- [Morse Cheat Sheet](../../develop/path/10_cheatsheet_morse.md) ::: From d1ad89cd90f3f337fbdb22f442c2f67a1681a29e Mon Sep 17 00:00:00 2001 From: Arash Deshmeh Date: Mon, 23 Jun 2025 20:12:17 -0400 Subject: [PATCH 6/9] Update copy script to set Grove Portal URL for load testing --- e2e/scripts/copy_load_test_config.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/e2e/scripts/copy_load_test_config.sh b/e2e/scripts/copy_load_test_config.sh index 7d1d39aad..25ef979f3 100755 --- a/e2e/scripts/copy_load_test_config.sh +++ b/e2e/scripts/copy_load_test_config.sh @@ -14,7 +14,7 @@ NC='\033[0m' # No Color TEMPLATE_FILE="./e2e/config/e2e_load_test.config.tmpl.yaml" CONFIG_FILE="./e2e/config/.e2e_load_test.config.yaml" -echo -e "${BLUE}🚀 Setting up E2E Load Test Configuration${NC}" +echo -e "${BLUE}🚀 Setting up E2E Load Test Configuration for Grove Portal${NC}" echo "" # Check if config file already exists @@ -50,7 +50,7 @@ fi echo -e "${BLUE}🔑 Portal Configuration Setup${NC}" echo "" echo -e "${BLUE}📝 Step 1: Portal Application ID${NC}" -echo -e "${WHITE} This is REQUIRED if you're testing against the Grove Portal.${NC}" +echo -e "${WHITE} This is REQUIRED for testing against the Grove Portal.${NC}" echo -e "${WHITE} If you don't have one, get it at: https://www.portal.grove.city${NC}" echo "" read -p "🆔 Enter your Portal Application ID (or press Enter to skip): " PORTAL_APP_ID @@ -74,6 +74,10 @@ echo -e "${GREEN}✅ Successfully copied template to config file${NC}" # Step 4: Update the config file with yq echo "⚙️ Updating configuration file..." +# Update gateway_url_override to point to Grove Portal +yq eval '.e2e_load_test_config.load_test_config.gateway_url_override = "https://rpc.grove.city/v1"' -i "$CONFIG_FILE" +echo -e "${GREEN}✅ Gateway URL set to Grove Portal${NC}" + if [ -n "$PORTAL_APP_ID" ]; then yq eval '.e2e_load_test_config.load_test_config.portal_application_id = "'"$PORTAL_APP_ID"'"' -i "$CONFIG_FILE" echo -e "${GREEN}✅ Portal Application ID set${NC}" @@ -89,9 +93,9 @@ echo -e "${GREEN}🎉 Configuration setup complete!${NC}" echo "" echo -e "${WHITE}💡 To customize the load test config further, edit: $CONFIG_FILE${NC}" echo "" -echo -e "${BLUE}🚀 You can now run load tests with:${NC}" +echo -e "${BLUE}🚀 You can now run load tests against the Grove Portal with:${NC}" echo -e "${WHITE} • make load_test${NC}" echo -e "${WHITE} • make load_test eth,anvil${NC}" echo "" echo -e "${WHITE} For a full list of all available services to run load tests on, see: ./config/service_qos_config.go" -echo "" +echo "" \ No newline at end of file From 8120f0b8297ee93ab1ec4f5f24b996a61e106762 Mon Sep 17 00:00:00 2001 From: Arash Deshmeh Date: Mon, 23 Jun 2025 21:35:45 -0400 Subject: [PATCH 7/9] Update service IDs in the Localnet Load Test config --- e2e/config/e2e_load_test.config.tmpl.yaml | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/e2e/config/e2e_load_test.config.tmpl.yaml b/e2e/config/e2e_load_test.config.tmpl.yaml index 3e9542ee5..29d559654 100644 --- a/e2e/config/e2e_load_test.config.tmpl.yaml +++ b/e2e/config/e2e_load_test.config.tmpl.yaml @@ -44,9 +44,9 @@ service_config_overrides: "anvil": global_rps: 1 requests_per_method: 3 - "arb_one": + "arb-one": archival: true - "arb_sep_test": + "arb-sepolia-testnet": archival: true "avax": archival: true @@ -54,7 +54,7 @@ service_config_overrides: archival: true "base": archival: true - "base-test": + "base-sepolia-testnet": archival: true "bera": archival: true @@ -70,9 +70,9 @@ service_config_overrides: archival: true "eth": archival: true - "eth_hol_test": + "eth-holesky-testnet": archival: true - "eth_sep_test": + "eth-sepolia-testnet": archival: true "evmos": archival: true @@ -110,7 +110,7 @@ service_config_overrides: archival: true "op": archival: true - "op_sep_test": + "op-sepolia-testnet": archival: true "opbnb": archival: true @@ -120,9 +120,9 @@ service_config_overrides: archival: true "poly": archival: true - "poly_amoy_test": + "poly-amoy-testnet": archival: true - "poly_zkevm": + "poly-zkevm": archival: true "radix": archival: true @@ -138,15 +138,15 @@ service_config_overrides: archival: true "taiko": archival: true - "taiko_hek_test": + "taiko-hekla-testnet": archival: true "tron": archival: true - "xrpl_evm_dev": + "xrplevm": archival: true - "xrpl_evm_test": + "xrplevm-testnet": archival: true - "zklink_nova": + "zklink-nova": archival: true "zksync_era": archival: true From 2f0d30e55d5d7e0ed8111cdbcba164a1a4755240 Mon Sep 17 00:00:00 2001 From: Arash Deshmeh Date: Mon, 30 Jun 2025 15:05:32 -0400 Subject: [PATCH 8/9] Update Tiltfile to create a secret for debug endpoints --- Tiltfile | 20 +++++++++++++++++++- local/path/values.tmpl.yaml | 2 ++ local/secrets.yaml | 22 ++++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 local/secrets.yaml diff --git a/Tiltfile b/Tiltfile index c706cda93..d4aefa816 100644 --- a/Tiltfile +++ b/Tiltfile @@ -3,6 +3,7 @@ load("ext://restart_process", "docker_build_with_restart") load("ext://helm_resource", "helm_resource", "helm_repo") load('ext://k8s_attach', 'k8s_attach') load("ext://configmap", "configmap_create") +load('ext://secret', 'secret_from_dict') # A list of directories where changes trigger a hot-reload of PATH. # IMPORTANT_DEV_NOTE: this list needs to be updated each time a new package is added to the repo. @@ -101,12 +102,15 @@ LOCAL_DIR = "local" PATH_LOCAL_DIR = LOCAL_DIR + "/path" # The configuration file for PATH. PATH_LOCAL_CONFIG_FILE = PATH_LOCAL_DIR + "/.config.yaml" +# The secrets file for local development. +SECRETS_FILE = LOCAL_DIR + "/secrets.yaml" # --------------------------------------------------------------------------- # # Configuration Resources # # --------------------------------------------------------------------------- # # 1. PATH Config Updater # -# 2. Patch Envoy Gateway LoadBalancer # +# 2. Local Development Secrets from secrets.yaml # +# 3. Patch Envoy Gateway LoadBalancer # # --------------------------------------------------------------------------- # # Start a Tilt resource to update the PATH config with the local config file. @@ -123,6 +127,20 @@ local_resource( labels=["configuration"], ) +# Load and create secrets from secrets.yaml using Tilt's secret extension +# This replaces the manual Python script approach with a cleaner Tilt-native solution +secrets_config = read_yaml(SECRETS_FILE, default={}) +if secrets_config: + print("Creating secrets from local/secrets.yaml...") + for secret_name, secret_data in secrets_config.items(): + print("Creating secret: " + secret_name) + k8s_yaml(secret_from_dict(secret_name, inputs=secret_data)) +else: + print("No secrets.yaml found or empty, skipping secret creation") + +# TODO_TECHDEBT(@adshmh): Migrate local development API keys to the new secrets.yaml file +# for centralized secret management and better organization. + # Start a Tilt resource to patch the Envoy Gateway LoadBalancer resource # to ensure it is reachable from outside the cluster at "localhost:3070". # diff --git a/local/path/values.tmpl.yaml b/local/path/values.tmpl.yaml index 431dd2577..f0f17c910 100644 --- a/local/path/values.tmpl.yaml +++ b/local/path/values.tmpl.yaml @@ -33,6 +33,8 @@ guard: # The auth section allows configuring the API key authentication for the PATH service. auth: + debug_endpoints: + api_key_secret_name: "path-debug-api-keys" apiKey: # To disable API key authentication, set `enabled` to `false`. enabled: true diff --git a/local/secrets.yaml b/local/secrets.yaml new file mode 100644 index 000000000..b24757c63 --- /dev/null +++ b/local/secrets.yaml @@ -0,0 +1,22 @@ +# Local development secrets configuration +# This file should be placed in PATH repo's `local/` directory +# +# Format: Each top-level key becomes a Kubernetes secret name +# The nested keys become the secret's data keys +# +# Example usage: +# path-debug-api-keys: +# api-key: "test_debug_api_key" + +# Debug endpoints authentication secret +# Used by GUARD for API key authentication on debug endpoints (/debug/pprof/*, /disqualified_endpoints) +# This provides a separate API key for debug access, isolated from main API authentication +path-debug-api-keys: + path-debug-api-key: "test_debug_api_key" + +# TODO_TECHDEBT(@adshmh): Migrate other local development API keys to this file +# Examples of secrets that could be added: +# +# path-main-api-keys: +# api-key-1: "test_api_key" +# api-key-2: "local_development_key" \ No newline at end of file From 7636c998272087b5b0746b73671d0b6ae66607f0 Mon Sep 17 00:00:00 2001 From: Arash Deshmeh Date: Tue, 1 Jul 2025 14:46:37 -0400 Subject: [PATCH 9/9] Add new developer doc page for debugging endpoints --- ..._helm.md => 10_ref_configurations_helm.md} | 2 +- ...tsheet_morse.md => 11_cheatsheet_morse.md} | 2 +- .../docs/develop/path/5_path_monitoring.md | 108 ++ ..._e2e_tests.md => 6_deep_dive_e2e_tests.md} | 2 +- ...oad_tests.md => 7_deep_dive_load_tests.md} | 2 +- ...elop_env.md => 8_deep_dive_develop_env.md} | 2 +- ...s_path.md => 9_ref_configurations_path.md} | 2 +- .../grafana-dashboards/go-runtime.json | 1149 ----------------- .../morse-relay-requests.json | 831 ------------ .../grafana-dashboards/path.json | 525 -------- .../grafana-dashboards/service-requests.json | 818 ------------ makefiles/devtools.mk | 60 +- 12 files changed, 168 insertions(+), 3335 deletions(-) rename docusaurus/docs/develop/path/{9_ref_configurations_helm.md => 10_ref_configurations_helm.md} (99%) rename docusaurus/docs/develop/path/{10_cheatsheet_morse.md => 11_cheatsheet_morse.md} (99%) create mode 100644 docusaurus/docs/develop/path/5_path_monitoring.md rename docusaurus/docs/develop/path/{5_deep_dive_e2e_tests.md => 6_deep_dive_e2e_tests.md} (99%) rename docusaurus/docs/develop/path/{6_deep_dive_load_tests.md => 7_deep_dive_load_tests.md} (99%) rename docusaurus/docs/develop/path/{7_deep_dive_develop_env.md => 8_deep_dive_develop_env.md} (99%) rename docusaurus/docs/develop/path/{8_ref_configurations_path.md => 9_ref_configurations_path.md} (99%) delete mode 100644 local/observability/grafana-dashboards/go-runtime.json delete mode 100644 local/observability/grafana-dashboards/morse-relay-requests.json delete mode 100644 local/observability/grafana-dashboards/path.json delete mode 100644 local/observability/grafana-dashboards/service-requests.json diff --git a/docusaurus/docs/develop/path/9_ref_configurations_helm.md b/docusaurus/docs/develop/path/10_ref_configurations_helm.md similarity index 99% rename from docusaurus/docs/develop/path/9_ref_configurations_helm.md rename to docusaurus/docs/develop/path/10_ref_configurations_helm.md index 5570002d3..b9ee9780e 100644 --- a/docusaurus/docs/develop/path/9_ref_configurations_helm.md +++ b/docusaurus/docs/develop/path/10_ref_configurations_helm.md @@ -1,5 +1,5 @@ --- -sidebar_position: 9 +sidebar_position: 10 title: Reference - PATH Helm Config (`.values.yaml`) description: PATH Helm Configurations --- diff --git a/docusaurus/docs/develop/path/10_cheatsheet_morse.md b/docusaurus/docs/develop/path/11_cheatsheet_morse.md similarity index 99% rename from docusaurus/docs/develop/path/10_cheatsheet_morse.md rename to docusaurus/docs/develop/path/11_cheatsheet_morse.md index 0bdd5c13e..b19ae1622 100644 --- a/docusaurus/docs/develop/path/10_cheatsheet_morse.md +++ b/docusaurus/docs/develop/path/11_cheatsheet_morse.md @@ -1,5 +1,5 @@ --- -sidebar_position: 10 +sidebar_position: 11 title: Morse Cheat Sheet (30-60 min) description: Introductory guide for setting up PATH w/ Morse --- diff --git a/docusaurus/docs/develop/path/5_path_monitoring.md b/docusaurus/docs/develop/path/5_path_monitoring.md new file mode 100644 index 000000000..afe3a0888 --- /dev/null +++ b/docusaurus/docs/develop/path/5_path_monitoring.md @@ -0,0 +1,108 @@ +--- +sidebar_position: 5 +title: Debugging and Profiling Tools +description: Advanced debugging tools for PATH performance and health analysis +--- + +## Table of Contents + +- [Health Check](#health-check) +- [Disqualified Endpoints](#disqualified-endpoints) +- [Performance Profiling (pprof)](#performance-profiling-pprof) + +**Prerequisites**: Complete the [Quick Start](1_quick_start.md) and [Shannon Cheat Sheet](2_cheatsheet_shannon.md) guides. + +## Health Check + +```bash +curl http://localhost:3070/healthz +``` + +
+Example response + +```json +{ + "status": "ready", + "imageTag": "development", + "readyStates": { + "endpoint-hydrator": true, + "pokt-shannon": true + }, + "configuredServiceIDs": [ + "arb-one", "arb-sepolia-testnet", "avax", "avax-dfk", "base", + "base-sepolia-testnet", "bera", "bitcoin", "blast", "boba", "bsc", + "celo", "eth", "eth-holesky-testnet", "eth-sepolia-testnet", "evmos", + "fantom", "fraxtal", "fuse", "gnosis", "harmony", "ink", "iotex", + "kaia", "kava", "linea", "mantle", "metis", "moonbeam", "moonriver", + "near", "oasys", "op", "op-sepolia-testnet", "opbnb", "osmosis", + "pocket", "poly", "poly-amoy-testnet", "poly-zkevm", "radix", + "scroll", "sei", "solana", "sonic", "sui", "taiko", + "taiko-hekla-testnet", "tron", "xrplevm", "xrplevm-testnet", + "zklink-nova", "zksync-era" + ] +} +``` + +
+ +## Disqualified Endpoints + +Check which RPC endpoints have been sanctioned at protocol level (e.g. malformed relay responses) or QoS level (e.g. empty responses): + +```bash +# Check disqualified endpoints for specific service +make get_disqualified_endpoints SERVICE_ID=eth +make get_disqualified_endpoints SERVICE_ID=base +``` + +
+Manual curl + +```bash +curl http://localhost:3070/disqualified_endpoints \ + -H "Authorization: test_debug_api_key" \ + -H "Target-Service-Id: eth" | jq +``` + +
+ +## Performance Profiling (pprof) + +Access Go pprof endpoints for performance analysis: + +```bash +make profile_cpu # Capture CPU profile +make profile_memory # Capture memory profile +make profile_goroutines # Capture goroutine profile +make pprof_index # View available endpoints +``` + +
+Manual curls + +```bash +# CPU profiling (30 seconds) +curl http://localhost:3070/debug/pprof/profile?seconds=30 \ + -H "Authorization: test_debug_api_key" -o cpu.prof + +# Memory profiling +curl http://localhost:3070/debug/pprof/heap \ + -H "Authorization: test_debug_api_key" -o mem.prof + +# Goroutine profiling +curl http://localhost:3070/debug/pprof/goroutine \ + -H "Authorization: test_debug_api_key" -o goroutine.prof + +# View all available profiles +curl http://localhost:3070/debug/pprof/ \ + -H "Authorization: test_debug_api_key" +``` + +
+ +:::info 🔑 **Debug API Key** + +The debug endpoints use a separate API key (`test_debug_api_key`) defined in `local/secrets.yaml` for security isolation. This is automatically configured in local development. + +::: \ No newline at end of file diff --git a/docusaurus/docs/develop/path/5_deep_dive_e2e_tests.md b/docusaurus/docs/develop/path/6_deep_dive_e2e_tests.md similarity index 99% rename from docusaurus/docs/develop/path/5_deep_dive_e2e_tests.md rename to docusaurus/docs/develop/path/6_deep_dive_e2e_tests.md index 0ecfd1782..766d2f8c9 100644 --- a/docusaurus/docs/develop/path/5_deep_dive_e2e_tests.md +++ b/docusaurus/docs/develop/path/6_deep_dive_e2e_tests.md @@ -1,5 +1,5 @@ --- -sidebar_position: 5 +sidebar_position: 6 title: Deep Dive - E2E Tests description: Deep dive into End-to-End Tests for PATH --- diff --git a/docusaurus/docs/develop/path/6_deep_dive_load_tests.md b/docusaurus/docs/develop/path/7_deep_dive_load_tests.md similarity index 99% rename from docusaurus/docs/develop/path/6_deep_dive_load_tests.md rename to docusaurus/docs/develop/path/7_deep_dive_load_tests.md index bbfcad61e..316f023e4 100644 --- a/docusaurus/docs/develop/path/6_deep_dive_load_tests.md +++ b/docusaurus/docs/develop/path/7_deep_dive_load_tests.md @@ -1,5 +1,5 @@ --- -sidebar_position: 6 +sidebar_position: 7 title: Deep Dive - Load Tests description: Deep dive into Load Tests for PATH --- diff --git a/docusaurus/docs/develop/path/7_deep_dive_develop_env.md b/docusaurus/docs/develop/path/8_deep_dive_develop_env.md similarity index 99% rename from docusaurus/docs/develop/path/7_deep_dive_develop_env.md rename to docusaurus/docs/develop/path/8_deep_dive_develop_env.md index c0e03a607..8a59ee0d7 100644 --- a/docusaurus/docs/develop/path/7_deep_dive_develop_env.md +++ b/docusaurus/docs/develop/path/8_deep_dive_develop_env.md @@ -1,5 +1,5 @@ --- -sidebar_position: 7 +sidebar_position: 8 title: Deep Dive - Local Development Environment description: Technical details and background information --- diff --git a/docusaurus/docs/develop/path/8_ref_configurations_path.md b/docusaurus/docs/develop/path/9_ref_configurations_path.md similarity index 99% rename from docusaurus/docs/develop/path/8_ref_configurations_path.md rename to docusaurus/docs/develop/path/9_ref_configurations_path.md index 1a13701de..41ace26e1 100644 --- a/docusaurus/docs/develop/path/8_ref_configurations_path.md +++ b/docusaurus/docs/develop/path/9_ref_configurations_path.md @@ -1,5 +1,5 @@ --- -sidebar_position: 8 +sidebar_position: 9 title: Reference - PATH Config File (`.config.yaml`) description: PATH Configurations --- diff --git a/local/observability/grafana-dashboards/go-runtime.json b/local/observability/grafana-dashboards/go-runtime.json deleted file mode 100644 index 745155313..000000000 --- a/local/observability/grafana-dashboards/go-runtime.json +++ /dev/null @@ -1,1149 +0,0 @@ -{ - "__inputs": [], - "__requires": [ - { - "type": "grafana", - "id": "grafana", - "name": "Grafana", - "version": "7.2.0" - }, - { - "type": "panel", - "id": "graph", - "name": "Graph", - "version": "" - }, - { - "type": "datasource", - "id": "prometheus", - "name": "Prometheus", - "version": "1.0.0" - } - ], - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": "-- Grafana --", - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "description": "A quickstart to setup the Prometheus Go runtime exporter with preconfigured dashboards, alerting rules, and recording rules.", - "editable": true, - "graphTooltip": 0, - "id": null, - "iteration": 1602794777869, - "links": [], - "panels": [ - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "description": "Average total bytes of memory reserved across all process instances of a job.", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 0 - }, - "hiddenSeries": false, - "id": 16, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "avg by(job)(go_memstats_sys_bytes{job=\"$job\", instance=~\"$instance\"})", - "interval": "", - "legendFormat": "{{job}} (avg)", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Total Reserved Memory", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "decbytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "description": "Average stack memory usage across all instances of a job.", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 0 - }, - "hiddenSeries": false, - "id": 24, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "avg by (job) (go_memstats_stack_sys_bytes{job=\"$job\", instance=~\"$instance\"})", - "interval": "", - "legendFormat": "{{job}}: stack inuse (avg)", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Stack Memory Use", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "decbytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "description": "Average memory reservations by the runtime, not for stack or heap, across all instances of a job.", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 8 - }, - "hiddenSeries": false, - "id": 26, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "avg by (job)(go_memstats_mspan_sys_bytes{job=\"$job\", instance=~\"$instance\"})", - "interval": "", - "legendFormat": "{{instance}}: mspan (avg)", - "refId": "B" - }, - { - "expr": "avg by (job)(go_memstats_mcache_sys_bytes{job=\"$job\", instance=~\"$instance\"})", - "interval": "", - "legendFormat": "{{instance}}: mcache (avg)", - "refId": "D" - }, - { - "expr": "avg by (job)(go_memstats_buck_hash_sys_bytes{job=\"$job\", instance=~\"$instance\"})", - "interval": "", - "legendFormat": "{{instance}}: buck hash (avg)", - "refId": "E" - }, - { - "expr": "avg by (job)(go_memstats_gc_sys_bytes{job=\"$job\", instance=~\"$instance\"})", - "interval": "", - "legendFormat": "{{job}}: gc (avg)", - "refId": "F" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Other Memory Reservations", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "decbytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": false - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "description": "Average memory reserved, and actually in use, by the heap, across all instances of a job.", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 8 - }, - "hiddenSeries": false, - "id": 12, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "avg by (job)(go_memstats_heap_sys_bytes{job=\"$job\", instance=~\"$instance\"})", - "interval": "", - "legendFormat": "{{job}}: heap reserved (avg)", - "refId": "B" - }, - { - "expr": "avg by (job)(go_memstats_heap_inuse_bytes{job=\"$job\", instance=~\"$instance\"})", - "interval": "", - "legendFormat": "{{job}}: heap in use (avg)", - "refId": "A" - }, - { - "expr": "avg by (job)(go_memstats_heap_alloc_bytes{job=~\"tns_app\",instance=~\".*\"})", - "interval": "", - "legendFormat": "{{job}}: heap alloc (avg)", - "refId": "C" - }, - { - "expr": "avg by (job)(go_memstats_heap_idle_bytes{job=~\"tns_app\",instance=~\".*\"})", - "interval": "", - "legendFormat": "{{job}}: heap idle (avg)", - "refId": "D" - }, - { - "expr": "avg by (job)(go_memstats_heap_released_bytes{job=~\"tns_app\",instance=~\".*\"})", - "interval": "", - "legendFormat": "{{job}}: heap released (avg)", - "refId": "E" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Heap Memory", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "decbytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "description": "Average allocation rate in bytes per second, across all instances of a job.", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 16 - }, - "hiddenSeries": false, - "id": 14, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 1, - "points": true, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "avg by (job)(rate(go_memstats_alloc_bytes_total{job=\"$job\", instance=~\"$instance\"}[$__rate_interval]))", - "interval": "", - "legendFormat": "{{job}}: bytes malloced/s (avg)", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Allocation Rate, Bytes", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "Bps", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": false - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "description": "Average rate of heap object allocation, across all instances of a job.", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 16 - }, - "hiddenSeries": false, - "id": 20, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "rate(go_memstats_mallocs_total{job=\"$job\", instance=~\"$instance\"}[$__rate_interval])", - "interval": "", - "legendFormat": "{{job}}: obj mallocs/s (avg)", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Heap Object Allocation Rate", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "description": "Average number of live memory objects across all instances of a job.", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 24 - }, - "hiddenSeries": false, - "id": 22, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "rightSide": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "avg by(job)(go_memstats_mallocs_total{job=\"$job\", instance=~\"$instance\"} - go_memstats_frees_total{job=\"$job\", instance=~\"$instance\"})", - "interval": "", - "legendFormat": "{{job}}: object count (avg)", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Number of Live Objects", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": false - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "description": "Average number of goroutines across instances of a job.", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 24 - }, - "hiddenSeries": false, - "id": 8, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "avg by (job)(go_goroutines{job=\"$job\", instance=~\"$instance\"})", - "interval": "", - "legendFormat": "{{job}}: goroutine count (avg)", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Goroutines", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "decimals": 0, - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 32 - }, - "hiddenSeries": false, - "id": 4, - "legend": { - "alignAsTable": false, - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "avg by (job)(go_gc_duration_seconds{quantile=\"0\", job=\"$job\", instance=~\"$instance\"})", - "interval": "", - "legendFormat": "{{job}}: min gc time (avg)", - "refId": "A" - }, - { - "expr": "avg by (job)(go_gc_duration_seconds{quantile=\"1\", job=\"$job\", instance=~\"$instance\"})", - "interval": "", - "legendFormat": "{{job}}: max gc time (avg)", - "refId": "B" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "GC min & max duration", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "ms", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "short", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - }, - { - "aliasColors": {}, - "bars": false, - "dashLength": 10, - "dashes": false, - "datasource": "$datasource", - "description": "The number used bytes at which the runtime plans to perform the next GC, averaged across all instances of a job.", - "fieldConfig": { - "defaults": { - "custom": {} - }, - "overrides": [] - }, - "fill": 1, - "fillGradient": 0, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 32 - }, - "hiddenSeries": false, - "id": 27, - "legend": { - "avg": false, - "current": false, - "max": false, - "min": false, - "show": true, - "total": false, - "values": false - }, - "lines": true, - "linewidth": 1, - "links": [], - "nullPointMode": "null", - "options": { - "dataLinks": [] - }, - "percentage": false, - "pointradius": 2, - "points": false, - "renderer": "flot", - "seriesOverrides": [], - "spaceLength": 10, - "stack": false, - "steppedLine": false, - "targets": [ - { - "expr": "avg by (job)(go_memstats_next_gc_bytes{job=\"$job\", instance=~\"$instance\"})", - "interval": "", - "legendFormat": "{{job}} next gc bytes (avg)", - "refId": "A" - } - ], - "thresholds": [], - "timeFrom": null, - "timeRegions": [], - "timeShift": null, - "title": "Next GC, Bytes", - "tooltip": { - "shared": true, - "sort": 0, - "value_type": "individual" - }, - "type": "graph", - "xaxis": { - "buckets": null, - "mode": "time", - "name": null, - "show": true, - "values": [] - }, - "yaxes": [ - { - "format": "decbytes", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - }, - { - "format": "s", - "label": null, - "logBase": 1, - "max": null, - "min": null, - "show": true - } - ], - "yaxis": { - "align": false, - "alignLevel": null - } - } - ], - "refresh": "5s", - "schemaVersion": 25, - "style": "dark", - "tags": ["go", "golang", "protocol"], - "templating": { - "list": [ - { - "current": { - "selected": false, - "text": "Prometheus", - "value": "Prometheus" - }, - "hide": 0, - "includeAll": false, - "label": null, - "multi": false, - "name": "datasource", - "options": [], - "query": "prometheus", - "queryValue": "", - "refresh": 1, - "regex": "", - "skipUrlSync": false, - "type": "datasource" - }, - { - "allValue": null, - "current": {}, - "datasource": "$datasource", - "definition": "label_values(go_info, job)", - "hide": 0, - "includeAll": false, - "label": "job", - "multi": false, - "name": "job", - "options": [], - "query": "label_values(go_info, job)", - "refresh": 2, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": ["protocol"], - "tagsQuery": "", - "type": "query", - "useTags": false - }, - { - "allValue": "", - "current": {}, - "datasource": "$datasource", - "definition": "label_values(go_info{job=\"$job\"}, instance)", - "hide": 0, - "includeAll": true, - "label": "instance", - "multi": true, - "name": "instance", - "options": [], - "query": "label_values(go_info{job=\"$job\"}, instance)", - "refresh": 2, - "regex": "", - "skipUrlSync": false, - "sort": 0, - "tagValuesQuery": "", - "tags": ["protocol"], - "tagsQuery": "", - "type": "query", - "useTags": false - } - ] - }, - "time": { - "from": "now-1h", - "to": "now" - }, - "timepicker": { - "refresh_intervals": [ - "10s", - "30s", - "1m", - "5m", - "15m", - "30m", - "1h", - "2h", - "1d" - ], - "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] - }, - "timezone": "", - "title": "Protocol / Go Runtime Exporter", - "uid": "CgCw8jKZz3", - "version": 3, - "gnetId": 14061 -} diff --git a/local/observability/grafana-dashboards/morse-relay-requests.json b/local/observability/grafana-dashboards/morse-relay-requests.json deleted file mode 100644 index 58f51aa22..000000000 --- a/local/observability/grafana-dashboards/morse-relay-requests.json +++ /dev/null @@ -1,831 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 2, - "links": [], - "panels": [ - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 1, - "panels": [], - "title": "Morse Relay Overview", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "max": 1, - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "orange", - "value": 0.5 - }, - { - "color": "yellow", - "value": 0.7 - }, - { - "color": "green", - "value": 0.9 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 1 - }, - "id": 2, - "options": { - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true - }, - "pluginVersion": "11.5.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "builder", - "expr": "sum(path_morse_relays_total{container=\"path\", success=\"true\"}) / sum(path_morse_relays_total{container=\"path\"})", - "instant": false, - "range": true, - "refId": "A" - } - ], - "title": "Overall Success Rate", - "type": "gauge" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "fillOpacity": 80, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineWidth": 1, - "scaleDistribution": { - "type": "linear" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 1 - }, - "id": 3, - "options": { - "barRadius": 0, - "barWidth": 0.97, - "groupWidth": 0.7, - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "orientation": "auto", - "showValue": "auto", - "stacking": "none", - "tooltip": { - "mode": "single", - "sort": "none" - }, - "xTickLabelRotation": 0, - "xTickLabelSpacing": 0 - }, - "pluginVersion": "11.5.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "builder", - "expr": "sum by(service_id) (path_morse_relays_total{container=\"path\", success=\"true\"}) / sum by(service_id) (path_morse_relays_total{container=\"path\"})", - "instant": false, - "range": true, - "refId": "A" - } - ], - "title": "Success Rate by Service ID", - "type": "barchart" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 2, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 9 - }, - "id": 4, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.5.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "builder", - "expr": "topk(10, sum by(session_height) (path_morse_relays_total{container=\"path\"}))", - "instant": false, - "legendFormat": "Session Height: {{session_height}}", - "range": true, - "refId": "A" - } - ], - "title": "Session Height Over Time", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" - }, - "inspect": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "orange", - "value": 0.3 - }, - { - "color": "red", - "value": 0.5 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "endpoint_addr" - }, - "properties": [ - { - "id": "custom.width", - "value": 300 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Error Rate" - }, - "properties": [ - { - "id": "custom.cellOptions", - "value": { - "type": "color-background" - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 9 - }, - "id": 5, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true - }, - "pluginVersion": "11.5.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "builder", - "expr": "bottomk(10, sum by(endpoint_addr) (path_morse_relay_errors_total{container=\"path\"}) / (sum by(endpoint_addr) (path_morse_relays_total{container=\"path\"})))", - "format": "table", - "instant": true, - "legendFormat": "__auto", - "range": false, - "refId": "A" - } - ], - "title": "Top 10 Endpoints with Highest Error Rate", - "transformations": [ - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true, - "Value": false - }, - "indexByName": {}, - "renameByName": { - "Value": "Error Rate" - } - } - } - ], - "type": "table" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 17 - }, - "id": 6, - "panels": [], - "title": "Error Details", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" - }, - "inspect": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "orange", - "value": 0.3 - }, - { - "color": "red", - "value": 0.5 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "app_address" - }, - "properties": [ - { - "id": "custom.width", - "value": 300 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "Error Rate" - }, - "properties": [ - { - "id": "custom.cellOptions", - "value": { - "type": "color-background" - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 18 - }, - "id": 7, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true - }, - "pluginVersion": "11.5.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "builder", - "expr": "bottomk(10, sum by(app_address) (path_morse_relay_errors_total{container=\"path\"}) / (sum by(app_address) (path_morse_relays_total{container=\"path\"})))", - "format": "table", - "instant": true, - "legendFormat": "__auto", - "range": false, - "refId": "A" - } - ], - "title": "Top 10 Applications with Highest Error Rate", - "transformations": [ - { - "id": "organize", - "options": { - "excludeByName": { - "Time": true, - "Value": false - }, - "indexByName": {}, - "renameByName": { - "Value": "Error Rate" - } - } - } - ], - "type": "table" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 2, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 18 - }, - "id": 8, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.5.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "builder", - "expr": "sum by(sanction_type) (path_morse_relay_errors_total{container=\"path\"})", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "Sanction Types Distribution Over Time", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - } - }, - "mappings": [] - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 26 - }, - "id": 9, - "options": { - "displayLabels": [ - "percent" - ], - "legend": { - "displayMode": "list", - "placement": "right", - "showLegend": true - }, - "pieType": "pie", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.5.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "builder", - "expr": "sum by(sanction_type) (path_morse_relay_errors_total{container=\"path\"})", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "Current Sanction Type Distribution", - "type": "piechart" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 2, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 26 - }, - "id": 10, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.5.1", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "editorMode": "builder", - "expr": "sum by(error_type) (path_morse_relay_errors_total{container=\"path\"})", - "legendFormat": "__auto", - "range": true, - "refId": "A" - } - ], - "title": "Error Types Distribution Over Time", - "type": "timeseries" - } - ], - "refresh": "10s", - "schemaVersion": 40, - "tags": [ - "path", - "morse", - "relays" - ], - "templating": { - "list": [] - }, - "time": { - "from": "now-3h", - "to": "now" - }, - "timepicker": {}, - "timezone": "browser", - "title": "Morse Relay Requests", - "uid": "morse-relays", - "version": 2, - "weekStart": "" -} diff --git a/local/observability/grafana-dashboards/path.json b/local/observability/grafana-dashboards/path.json deleted file mode 100644 index 69af1c139..000000000 --- a/local/observability/grafana-dashboards/path.json +++ /dev/null @@ -1,525 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 2, - "links": [], - "panels": [ - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 5, - "panels": [], - "title": "OS metrics", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 100, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 0, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "short" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "requests" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#F2495C", - "mode": "fixed" - } - }, - { - "id": "custom.fillOpacity", - "value": 0 - }, - { - "id": "custom.lineWidth", - "value": 2 - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "none" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "limits" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#FF9830", - "mode": "fixed" - } - }, - { - "id": "custom.fillOpacity", - "value": 0 - }, - { - "id": "custom.lineWidth", - "value": 2 - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "none" - } - } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 1 - }, - "id": 6, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.4.0", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "disableTextWrap": false, - "editorMode": "builder", - "expr": "sum by(container) (node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{pod=~\"path\"})", - "format": "time_series", - "fullMetaSearch": false, - "includeNullMetadata": true, - "legendFormat": "{{container}}", - "range": true, - "refId": "A", - "useBackend": false - }, - { - "datasource": { - "uid": "$datasource" - }, - "editorMode": "code", - "expr": "sum(\n kube_pod_container_resource_requests{pod=~\"^$path.*\", resource=\"cpu\"}\n)\n", - "format": "time_series", - "legendFormat": "requests", - "range": true, - "refId": "B" - }, - { - "datasource": { - "uid": "$datasource" - }, - "editorMode": "code", - "expr": "sum(\n kube_pod_container_resource_limits{pod=~\"^$path.*\", resource=\"cpu\"}\n)\n", - "format": "time_series", - "legendFormat": "limits", - "range": true, - "refId": "C" - } - ], - "title": "CPU Usage", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 100, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 0, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "bytes" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "requests" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#F2495C", - "mode": "fixed" - } - }, - { - "id": "custom.fillOpacity", - "value": 0 - }, - { - "id": "custom.lineWidth", - "value": 2 - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "none" - } - }, - { - "id": "custom.lineStyle", - "value": { - "dash": [ - 10, - 10 - ], - "fill": "dash" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "limits" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "#FF9830", - "mode": "fixed" - } - }, - { - "id": "custom.fillOpacity", - "value": 0 - }, - { - "id": "custom.lineWidth", - "value": 2 - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "none" - } - }, - { - "id": "custom.lineStyle", - "value": { - "dash": [ - 10, - 10 - ], - "fill": "dash" - } - } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 1 - }, - "id": 7, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "11.4.0", - "targets": [ - { - "datasource": { - "uid": "$datasource" - }, - "disableTextWrap": false, - "editorMode": "builder", - "expr": "sum by(container) (container_memory_working_set_bytes{job=\"kubelet\", metrics_path=\"/metrics/cadvisor\", pod=~\"path\"})", - "format": "time_series", - "fullMetaSearch": false, - "includeNullMetadata": true, - "legendFormat": "{{container}}", - "range": true, - "refId": "A", - "useBackend": false - }, - { - "datasource": { - "uid": "$datasource" - }, - "editorMode": "code", - "expr": "sum(\n kube_pod_container_resource_requests{job=\"kube-state-metrics\", pod=~\"^$path.*\", resource=\"memory\"}\n)\n", - "format": "time_series", - "legendFormat": "requests", - "range": true, - "refId": "B" - }, - { - "datasource": { - "uid": "$datasource" - }, - "editorMode": "code", - "expr": "sum(\n kube_pod_container_resource_limits{job=\"kube-state-metrics\", pod=~\"^$path.*\", resource=\"memory\"}\n)\n", - "format": "time_series", - "legendFormat": "limits", - "range": true, - "refId": "C" - } - ], - "title": "Memory Usage (WSS)", - "type": "timeseries" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 10 - }, - "id": 3, - "panels": [], - "title": "Logs", - "type": "row" - }, - { - "datasource": { - "type": "loki", - "uid": "P8E80F9AEF21F6940" - }, - "fieldConfig": { - "defaults": {}, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 11 - }, - "id": 4, - "options": { - "dedupStrategy": "none", - "enableLogDetails": true, - "prettifyLogMessage": false, - "showCommonLabels": false, - "showLabels": false, - "showTime": true, - "sortOrder": "Descending", - "wrapLogMessage": true - }, - "pluginVersion": "11.4.0", - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "P8E80F9AEF21F6940" - }, - "editorMode": "builder", - "expr": "{instance=\"path\"} |= `` | json", - "queryType": "range", - "refId": "A" - } - ], - "title": "Logs", - "type": "logs" - } - ], - "preload": false, - "refresh": "5s", - "schemaVersion": 40, - "tags": [ - "path" - ], - "templating": { - "list": [ - { - "current": { - "text": "path", - "value": "path" - }, - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "definition": "label_values(go_info{container=\"path\"},job)", - "includeAll": false, - "name": "path", - "options": [], - "query": { - "qryType": 1, - "query": "label_values(go_info{container=\"path\"},job)", - "refId": "PrometheusVariableQueryEditor-VariableQuery" - }, - "refresh": 1, - "regex": "", - "type": "query" - } - ] - }, - "time": { - "from": "now-1h", - "to": "now" - }, - "timepicker": {}, - "timezone": "browser", - "title": "PATH / PATH Gateway", - "uid": "gateway", - "version": 14, - "weekStart": "" -} diff --git a/local/observability/grafana-dashboards/service-requests.json b/local/observability/grafana-dashboards/service-requests.json deleted file mode 100644 index c821fb43c..000000000 --- a/local/observability/grafana-dashboards/service-requests.json +++ /dev/null @@ -1,818 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 3, - "links": [], - "panels": [ - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 3, - "panels": [], - "title": "Request Metrics", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 1 - }, - "id": 1, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.5.2", - "targets": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "disableTextWrap": false, - "editorMode": "builder", - "expr": "sum by(service_id) (path_requests_total{container=\"path\"})", - "fullMetaSearch": false, - "includeNullMetadata": true, - "legendFormat": "__auto", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "Received Requests", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 1 - }, - "id": 6, - "options": { - "displayMode": "gradient", - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": false - }, - "maxVizHeight": 300, - "minVizHeight": 16, - "minVizWidth": 8, - "namePlacement": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": true, - "sizing": "auto", - "valueMode": "color" - }, - "pluginVersion": "11.5.2", - "targets": [ - { - "disableTextWrap": false, - "editorMode": "builder", - "expr": "path_response_size_bytes_bucket{container=\"path\"}", - "format": "heatmap", - "fullMetaSearch": false, - "includeNullMetadata": true, - "legendFormat": "{{le}}", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "Histogram of Response Size in Bytes", - "type": "bargauge" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 9 - }, - "id": 4, - "panels": [], - "title": "QoS Metrics", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "Number of requests with validation error", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 10 - }, - "id": 8, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.5.2", - "targets": [ - { - "disableTextWrap": false, - "editorMode": "builder", - "expr": "sum by(validation_error_kind) (path_evm_request_validation_errors_total{container=\"path\"})", - "fullMetaSearch": false, - "includeNullMetadata": true, - "legendFormat": "__auto", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "EVM QoS Request Validation Errors by Error Kind", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 10 - }, - "id": 5, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.5.2", - "targets": [ - { - "disableTextWrap": false, - "editorMode": "builder", - "expr": "sum by(chain_id) (path_evm_requests_total{container=\"path\"})", - "fullMetaSearch": false, - "includeNullMetadata": true, - "legendFormat": "__auto", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "EVM QoS Requests Success by Chain ID", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "Number of Requests", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 18 - }, - "id": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.5.2", - "targets": [ - { - "disableTextWrap": false, - "editorMode": "builder", - "expr": "sum by(request_method) (path_evm_requests_total{container=\"path\"})", - "fullMetaSearch": false, - "includeNullMetadata": true, - "legendFormat": "__auto", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "EVM QoS Service Requests by Method", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "Number of Invalid Responses", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 18 - }, - "id": 7, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.5.2", - "targets": [ - { - "disableTextWrap": false, - "editorMode": "builder", - "expr": "sum by(invalid_response_reason) (path_evm_requests_total{container=\"path\"})", - "fullMetaSearch": false, - "includeNullMetadata": true, - "legendFormat": "__auto", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "EVM QoS Invalid Response by Error Kind", - "type": "timeseries" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 26 - }, - "id": 9, - "panels": [], - "title": "HTTP Status", - "type": "row" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "description": "Visualization of HTTP status codes across all requests with both total count and proportional distribution", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "red", - "value": 0 - }, - { - "color": "yellow", - "value": 90 - }, - { - "color": "green", - "value": 95 - } - ] - }, - "unit": "percent" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 27 - }, - "id": 10, - "options": { - "minVizHeight": 75, - "minVizWidth": 75, - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showThresholdLabels": false, - "showThresholdMarkers": true, - "sizing": "auto" - }, - "pluginVersion": "11.5.2", - "targets": [ - { - "disableTextWrap": false, - "editorMode": "code", - "expr": "sum(path_evm_requests_total{container=\"path\", http_status_code=~\"2..\"}) / \nsum(path_evm_requests_total{container=\"path\"}) * 100 ", - "fullMetaSearch": false, - "includeNullMetadata": true, - "legendFormat": "HTTP {{http_status_code}}", - "range": true, - "refId": "A", - "useBackend": false - } - ], - "title": "Successful Response Rate (%)", - "type": "gauge" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "description": "Detailed breakdown of HTTP status codes over time", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "barWidthFactor": 0.6, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 27 - }, - "id": 11, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "hideZeros": false, - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "11.5.2", - "targets": [ - { - "editorMode": "code", - "expr": "sum by(http_status_code) (rate(path_evm_requests_total{container=\"path\"}[$__rate_interval]))", - "legendFormat": "HTTP {{http_status_code}}", - "range": true, - "refId": "A" - } - ], - "title": "HTTP Status Codes Over Time", - "type": "timeseries" - } - ], - "preload": false, - "schemaVersion": 40, - "tags": [ - "path", - "requests" - ], - "templating": { - "list": [] - }, - "time": { - "from": "now-15m", - "to": "now" - }, - "timepicker": {}, - "timezone": "browser", - "title": "PATH / Service Requests", - "uid": "relays", - "version": 1, - "weekStart": "" -} \ No newline at end of file diff --git a/makefiles/devtools.mk b/makefiles/devtools.mk index 6a01d4618..f786c4d59 100644 --- a/makefiles/devtools.mk +++ b/makefiles/devtools.mk @@ -2,16 +2,17 @@ ### Devtools Make Targets ### ############################# -# Default service ID if not specified -SERVICE_ID ?= eth +# Default Debug API Key if not specified. +DEBUG_API_KEY ?= test_debug_api_key # Target to check disqualified endpoints for a specific service -# Usage: make get_disqualified_endpoints SERVICE_ID=base -# or: make get_disqualified_endpoints (uses default SERVICE_ID=eth) +# Usage: make get_disqualified_endpoints SERVICE_ID=base (SERVICE_ID is required) .PHONY: get_disqualified_endpoints -get_disqualified_endpoints: check_jq ## Fetch disqualified endpoints for a specific service +get_disqualified_endpoints: check_jq check_service_id ## Fetch disqualified endpoints for a specific service @echo "🔎 Fetching disqualified endpoints for service: $(SERVICE_ID)" - curl http://localhost:3069/disqualified_endpoints -H "Target-Service-Id: $(SERVICE_ID)" | jq + curl http://localhost:3069/disqualified_endpoints \ + -H "Authorization: $(DEBUG_API_KEY)" \ + -H "Target-Service-Id: $(SERVICE_ID)" | jq # DEV_NOTE: in prod the Grove Portal's GUARD will assign the service ID from the subdomain to the `Target-Service-Id` header. # Usage: make grove_get_disqualified_endpoints SERVICE_ID=base @@ -21,6 +22,53 @@ grove_get_disqualified_endpoints: check_jq ## Fetch disqualified endpoints for G @echo "🔎 Fetching disqualified endpoints for Grove's $(SERVICE_ID) service" curl https://$(SERVICE_ID).rpc.grove.city/disqualified_endpoints | jq +# Health check endpoint +.PHONY: health_check +health_check: ## Check PATH service health + @echo "🏥 Checking PATH service health..." + curl http://localhost:3070/healthz + +# Performance profiling endpoints +.PHONY: profile_cpu +profile_cpu: ## Capture CPU profile (30 seconds) + @echo "📊 Capturing CPU profile for 30 seconds..." + curl http://localhost:3070/debug/pprof/profile?seconds=30 \ + -H "Authorization: $(DEBUG_API_KEY)" \ + -o cpu-$(shell date +%Y%m%d_%H%M%S).prof + @echo "✅ CPU profile saved as cpu-$(shell date +%Y%m%d_%H%M%S).prof" + +.PHONY: profile_memory +profile_memory: ## Capture memory heap profile + @echo "🧠 Capturing memory heap profile..." + curl http://localhost:3070/debug/pprof/heap \ + -H "Authorization: $(DEBUG_API_KEY)" \ + -o mem-$(shell date +%Y%m%d_%H%M%S).prof + @echo "✅ Memory profile saved as mem-$(shell date +%Y%m%d_%H%M%S).prof" + +.PHONY: profile_goroutines +profile_goroutines: ## Capture goroutine profile + @echo "🔄 Capturing goroutine profile..." + curl http://localhost:3070/debug/pprof/goroutine \ + -H "Authorization: $(DEBUG_API_KEY)" \ + -o goroutine-$(shell date +%Y%m%d_%H%M%S).prof + @echo "✅ Goroutine profile saved as goroutine-$(shell date +%Y%m%d_%H%M%S).prof" + +.PHONY: pprof_index +pprof_index: ## View all available pprof endpoints + @echo "📋 Available pprof endpoints:" + curl http://localhost:3070/debug/pprof/ -H "Authorization: $(DEBUG_API_KEY)" + +# Convenience target for all monitoring commands (requires SERVICE_ID) +.PHONY: monitor +monitor: check_service_id health_check get_disqualified_endpoints pprof_index ## Run all monitoring checks + +.PHONY: check_service_id +check_service_id: ## Check if SERVICE_ID is provided + @if [ -z "$(SERVICE_ID)" ]; then \ + echo "🚨 SERVICE_ID is required. Usage: make SERVICE_ID=eth"; \ + exit 1; \ + fi + .PHONY: check_jq check_jq: ## Checks if jq is installed @if ! command -v jq &> /dev/null; then \