Skip to content

feat: update tracing crate to thin aptos-telemetry wrapper #1246

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jun 25, 2025
Merged
5,273 changes: 3,943 additions & 1,330 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 4 additions & 8 deletions docker/compose/movement-full-node/docker-compose.telemetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,23 @@ services:

movement-full-node:
environment:
- MOVEMENT_METRICS_ADDR=127.0.0.1:9464
- MOVEMENT_OTLP=http://otel-collector:4317
- MOVEMENT_METRICS_ADDR=0.0.0.0:9464
- APTOS_TELEMETRY_SERVICE_ENDPOINT=/metrics
ports:
- "9464:9464"
depends_on:
- prometheus:
condition: service_healthy
- otel-collector:
condition: service_healthy

movement-celestia-da-light-node:
environment:
- MOVEMENT_METRICS_ADDR=127.0.0.1:9464
- MOVEMENT_OTLP=http://otel-collector:4317
- MOVEMENT_METRICS_ADDR=0.0.0.0:9464
- APTOS_TELEMETRY_SERVICE_ENDPOINT=/metrics
ports:
- "9465:9464"
depends_on:
- prometheus:
condition: service_healthy
- otel-collector:
condition: service_healthy

otel-collector:
image: otel/opentelemetry-collector:0.96.0
Expand Down
10 changes: 8 additions & 2 deletions docker/compose/movement-full-node/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ global:
evaluation_interval: 15s

scrape_configs:
- job_name: "movement-full-node"
- job_name: "movement-metrics"
static_configs:
- targets: ["127.0.0.1:9464"]
- targets: ["movement-full-node:9464"]
metrics_path: /metrics
scheme: http

- job_name: "movement-celestia-da-light-node"
static_configs:
- targets: ["movement-celestia-da-light-node:9464"]
metrics_path: /metrics
scheme: http
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,7 @@ pub async fn basic_coin_transfers(
#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
let dot_movement = DotMovement::try_from_env().context("Failed to get .movement path")?;
let _config = get_movement_config(&dot_movement)?;
let tracing_config = movement_tracing::Config::default();
let _guard = movement_tracing::init_tracing_subscriber(tracing_config);
let config = get_movement_config(&dot_movement)?;

// Get the follower count from the first argument.
let follower_count = std::env::args()
Expand Down
6 changes: 0 additions & 6 deletions networks/movement/movement-full-node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@

use clap::*;
use movement_full_node::MovementFullNode;
use std::time::Duration;

#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
let tracing_config = movement_tracing::Config::default();
let _guard = movement_tracing::init_telemetry(tracing_config).await;

tokio::time::sleep(Duration::from_secs(1)).await;

let suzuka_util = MovementFullNode::parse();
let result = suzuka_util.execute().await;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,16 @@
version: "3"

environment:
- RUST_LOG=info

processes:
prometheus:
is_daemon: true
movement-telemetry:
command: |
mkdir -p ${PWD}/tmp/prometheus
cp ${PWD}/docker/compose/movement-full-node/prometheus.yml ${PWD}/tmp/prometheus/prometheus.yml
sed -i.bak 's/movement-full-node:9464/127.0.0.1:9464/g' ${PWD}/tmp/prometheus/prometheus.yml
prometheus --config.file=${PWD}/tmp/prometheus/prometheus.yml --storage.tsdb.path=${PWD}/tmp/prometheus/data --web.listen-address=0.0.0.0:9091 --web.enable-lifecycle
shutdown:
command: |
pkill -f "prometheus --config.file"
readiness_probe:
initial_delay_seconds: 3
exec:
command: curl -s http://127.0.0.1:9091/-/healthy || exit 1

movement-full-node:
depends_on:
prometheus:
condition: process_started
cargo run -p movement-tracing
environment:
- MOVEMENT_METRICS_ADDR=127.0.0.1:9464
- MOVEMENT_METRICS_ADDR=0.0.0.0:9464
- APTOS_FORCE_ENABLE_TELEMETRY=1
- RUST_LOG=debug,aptos_telemetry=debug
- APTOS_METRICS_PORT=9464
- APTOS_DISABLE_TELEMETRY_PUSH_METRICS=1
- PROMETHEUS_METRICS_ENABLED=1
2 changes: 2 additions & 0 deletions process-compose/movement-full-node/process-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ processes:
initial_delay_seconds: 10
exec:
command: curl http://0.0.0.0:30731
ports:
- "9464:9464" # Expose metrics endpoint

movement-faucet:
command : |
Expand Down
3 changes: 0 additions & 3 deletions protocol-units/da/movement/protocol/light-node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ use movement_signer_loader::LoadedSigner;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let tracing_config = movement_tracing::Config::default();
let _guard = movement_tracing::init_tracing_subscriber(tracing_config);

let dot_movement = dot_movement::DotMovement::try_from_env()?;
let config_path = dot_movement.get_config_json_path();
let config_file = tokio::fs::File::open(config_path).await?;
Expand Down
26 changes: 17 additions & 9 deletions util/tracing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,25 @@ repository.workspace = true
homepage.workspace = true
publish.workspace = true
rust-version.workspace = true
default-run = "movement-tracing"

[dependencies]
tracing = { workspace = true }
tracing-subscriber = { workspace = true, features = ["json"] }
opentelemetry = { version = "0.28", features = ["metrics"] }
opentelemetry_sdk = { version = "0.28", features = ["metrics", "rt-tokio"] }
opentelemetry-prometheus = { version = "0.28" }
prometheus = { version = "0.13.4", features = ["process"] }
tokio = { workspace = true, features = ["full"] }
godfig = { workspace = true }
serde = { workspace = true, features = ["derive"] }
aptos-logger = { git = "https://github.com/movementlabsxyz/aptos-core.git", branch = "movement" }
aptos-telemetry = { git = "https://github.com/movementlabsxyz/aptos-core.git", branch = "movement" }
aptos-types = { git = "https://github.com/movementlabsxyz/aptos-core.git", branch = "movement" }
aptos-config = { git = "https://github.com/movementlabsxyz/aptos-core.git", branch = "movement" }
aptos-crypto = { git = "https://github.com/movementlabsxyz/aptos-core.git", branch = "movement" }
movement-config = { workspace = true }
dot-movement = { workspace = true }
once_cell = { workspace = true }
tokio = { workspace = true }
hex = { workspace = true }
rand = { workspace = true }
ring = "0.17.7"
warp = "0.3"
prometheus = "0.13"
clap = { workspace = true }
lazy_static = "1.4.0"

[lints]
workspace = true
Loading
Loading