-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: multi-node metrics working (#9486)
After this PR: - switched to deployment of metrics helm chart, meaning we are just a normal endpoint and don't try to do k8s-aware log scraping - Now code that passes LOG_JSON and OTEL_EXPORTER_OTLP_LOGS_ENDPOINT will use winston otel transport to log to that otel endpoint (making its way into grafana eventually) - Adjustments in helm chart and winston transport side enabling logging, see working here: <img width="1228" alt="Screenshot 2024-10-29 at 8 38 01 PM" src="https://github.com/user-attachments/assets/c141eac7-8ea6-4ed6-9ba9-5b181e89775c"> This was from the scripts/run_native_testnet_with_metrics.sh script that got the publicly available metrics deployment and pointed the local testnet scripts at it. - minor fix for earthly s3 caching - new post_deploy_spartan.sh script that runs 'network-bootstrap' that initializes the network with some key test contracts - refactor logging a bit to make it the negative patterns useful for all logging pathways + extract logic added for offsite demo into its own functional wrapper for adding 'fixed data' - Closes #9234
- Loading branch information
Showing
26 changed files
with
431 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
NAMESPACE=${1:-staging} | ||
|
||
echo "Trying to port forward. NOTE: Must be using a production k8s context with metrics chart." | ||
|
||
# Helper function to get load balancer URL based on namespace and service name | ||
function get_load_balancer_url() { | ||
local namespace=$1 | ||
local service_name=$2 | ||
kubectl get svc -n $namespace -o jsonpath="{.items[?(@.metadata.name=='$service_name')].status.loadBalancer.ingress[0].hostname}" | ||
} | ||
|
||
# Fetch the service URLs based on the namespace for injection in the test-transfer.sh | ||
OTEL_URL=http://$(get_load_balancer_url metrics metrics-opentelemetry-collector):4318 | ||
|
||
export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT=$OTEL_URL/v1/metrics | ||
export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=$OTEL_URL/v1/trace | ||
export OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=$OTEL_URL/v1/logs | ||
export LOG_JSON=1 | ||
|
||
# re-enter script dir | ||
cd $(dirname "${BASH_SOURCE[0]}") | ||
./run_native_testnet.sh $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
helm upgrade metrics . -n metrics --values "./values/prod.yaml" --install --create-namespace --atomic | ||
cd "$(dirname "${BASH_SOURCE[0]}")" | ||
|
||
helm upgrade metrics . -n metrics --values "./values/prod.yaml" --install --create-namespace --atomic $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
# Targets a running cluster and deploys example contracts for testing | ||
set -eu | ||
set -o pipefail | ||
|
||
echo "Bootstrapping network with test contracts" | ||
|
||
NAMESPACE=${1:-spartan} | ||
TAG=${2:-latest} | ||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
||
if [ -z "$NAMESPACE" ]; then | ||
echo "Usage: $0 (optional: <namespace>)" | ||
echo "Example: $0 devnet" | ||
exit 1 | ||
fi | ||
|
||
# Helper function to get load balancer URL based on namespace and service name | ||
function get_load_balancer_url() { | ||
local namespace=$1 | ||
local service_name=$2 | ||
kubectl get svc -n $namespace -o jsonpath="{.items[?(@.metadata.name=='$service_name')].status.loadBalancer.ingress[0].hostname}" | ||
} | ||
|
||
# Fetch the service URLs based on the namespace for injection in the test-transfer.sh | ||
export BOOTNODE_URL=http://$(get_load_balancer_url $NAMESPACE "$NAMESPACE-aztec-network-boot-node-lb-tcp"):8080 | ||
export PXE_URL=http://$(get_load_balancer_url $NAMESPACE "$NAMESPACE-aztec-network-pxe-lb"):8080 | ||
export ETHEREUM_HOST=http://$(get_load_balancer_url $NAMESPACE "$NAMESPACE-aztec-network-ethereum-lb"):8545 | ||
|
||
echo "BOOTNODE_URL: $BOOTNODE_URL" | ||
echo "PXE_URL: $PXE_URL" | ||
echo "ETHEREUM_HOST: $ETHEREUM_HOST" | ||
|
||
echo "Bootstrapping contracts for test network. NOTE: This took one hour last run." | ||
# hack to ensure L2 contracts are considered deployed | ||
docker run aztecprotocol/aztec:$TAG bootstrap-network \ | ||
--rpc-url $BOOTNODE_URL \ | ||
--l1-rpc-url $ETHEREUM_HOST \ | ||
--l1-chain-id 31337 \ | ||
--l1-private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 \ | ||
--json | tee ./basic_contracts.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.