Skip to content

Commit 06b1562

Browse files
authored
feat: update tracing crate to thin aptos-telemetry wrapper (#1246)
1 parent 86362bd commit 06b1562

File tree

11 files changed

+4381
-1603
lines changed

11 files changed

+4381
-1603
lines changed

Cargo.lock

Lines changed: 3943 additions & 1330 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker/compose/movement-full-node/docker-compose.telemetry.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,23 @@ services:
3434

3535
movement-full-node:
3636
environment:
37-
- MOVEMENT_METRICS_ADDR=127.0.0.1:9464
38-
- MOVEMENT_OTLP=http://otel-collector:4317
37+
- MOVEMENT_METRICS_ADDR=0.0.0.0:9464
38+
- APTOS_TELEMETRY_SERVICE_ENDPOINT=/metrics
3939
ports:
4040
- "9464:9464"
4141
depends_on:
4242
- prometheus:
4343
condition: service_healthy
44-
- otel-collector:
45-
condition: service_healthy
4644

4745
movement-celestia-da-light-node:
4846
environment:
49-
- MOVEMENT_METRICS_ADDR=127.0.0.1:9464
50-
- MOVEMENT_OTLP=http://otel-collector:4317
47+
- MOVEMENT_METRICS_ADDR=0.0.0.0:9464
48+
- APTOS_TELEMETRY_SERVICE_ENDPOINT=/metrics
5149
ports:
5250
- "9465:9464"
5351
depends_on:
5452
- prometheus:
5553
condition: service_healthy
56-
- otel-collector:
57-
condition: service_healthy
5854

5955
otel-collector:
6056
image: otel/opentelemetry-collector:0.96.0

docker/compose/movement-full-node/prometheus.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@ global:
33
evaluation_interval: 15s
44

55
scrape_configs:
6-
- job_name: "movement-full-node"
6+
- job_name: "movement-metrics"
77
static_configs:
8-
- targets: ["127.0.0.1:9464"]
8+
- targets: ["movement-full-node:9464"]
9+
metrics_path: /metrics
10+
scheme: http
11+
12+
- job_name: "movement-celestia-da-light-node"
13+
static_configs:
14+
- targets: ["movement-celestia-da-light-node:9464"]
915
metrics_path: /metrics
1016
scheme: http

networks/movement/movement-client/src/bin/e2e/followers_consistent.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,7 @@ pub async fn basic_coin_transfers(
393393
#[tokio::main]
394394
async fn main() -> Result<(), anyhow::Error> {
395395
let dot_movement = DotMovement::try_from_env().context("Failed to get .movement path")?;
396-
let _config = get_movement_config(&dot_movement)?;
397-
let tracing_config = movement_tracing::Config::default();
398-
let _guard = movement_tracing::init_tracing_subscriber(tracing_config);
396+
let config = get_movement_config(&dot_movement)?;
399397

400398
// Get the follower count from the first argument.
401399
let follower_count = std::env::args()

networks/movement/movement-full-node/src/main.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,9 @@
22

33
use clap::*;
44
use movement_full_node::MovementFullNode;
5-
use std::time::Duration;
65

76
#[tokio::main]
87
async fn main() -> Result<(), anyhow::Error> {
9-
let tracing_config = movement_tracing::Config::default();
10-
let _guard = movement_tracing::init_telemetry(tracing_config).await;
11-
12-
tokio::time::sleep(Duration::from_secs(1)).await;
13-
148
let suzuka_util = MovementFullNode::parse();
159
let result = suzuka_util.execute().await;
1610

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,16 @@
11
version: "3"
22

33
environment:
4+
- RUST_LOG=info
45

56
processes:
6-
prometheus:
7-
is_daemon: true
7+
movement-telemetry:
88
command: |
9-
mkdir -p ${PWD}/tmp/prometheus
10-
cp ${PWD}/docker/compose/movement-full-node/prometheus.yml ${PWD}/tmp/prometheus/prometheus.yml
11-
sed -i.bak 's/movement-full-node:9464/127.0.0.1:9464/g' ${PWD}/tmp/prometheus/prometheus.yml
12-
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
13-
shutdown:
14-
command: |
15-
pkill -f "prometheus --config.file"
16-
readiness_probe:
17-
initial_delay_seconds: 3
18-
exec:
19-
command: curl -s http://127.0.0.1:9091/-/healthy || exit 1
20-
21-
movement-full-node:
22-
depends_on:
23-
prometheus:
24-
condition: process_started
9+
cargo run -p movement-tracing
2510
environment:
26-
- MOVEMENT_METRICS_ADDR=127.0.0.1:9464
11+
- MOVEMENT_METRICS_ADDR=0.0.0.0:9464
12+
- APTOS_FORCE_ENABLE_TELEMETRY=1
13+
- RUST_LOG=debug,aptos_telemetry=debug
14+
- APTOS_METRICS_PORT=9464
15+
- APTOS_DISABLE_TELEMETRY_PUSH_METRICS=1
16+
- PROMETHEUS_METRICS_ENABLED=1

process-compose/movement-full-node/process-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ processes:
4747
initial_delay_seconds: 10
4848
exec:
4949
command: curl http://0.0.0.0:30731
50+
ports:
51+
- "9464:9464" # Expose metrics endpoint
5052

5153
movement-faucet:
5254
command : |

protocol-units/da/movement/protocol/light-node/src/main.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ use movement_signer_loader::LoadedSigner;
77

88
#[tokio::main]
99
async fn main() -> Result<(), Box<dyn std::error::Error>> {
10-
let tracing_config = movement_tracing::Config::default();
11-
let _guard = movement_tracing::init_tracing_subscriber(tracing_config);
12-
1310
let dot_movement = dot_movement::DotMovement::try_from_env()?;
1411
let config_path = dot_movement.get_config_json_path();
1512
let config_file = tokio::fs::File::open(config_path).await?;

util/tracing/Cargo.toml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,25 @@ repository.workspace = true
99
homepage.workspace = true
1010
publish.workspace = true
1111
rust-version.workspace = true
12+
default-run = "movement-tracing"
1213

1314
[dependencies]
14-
tracing = { workspace = true }
15-
tracing-subscriber = { workspace = true, features = ["json"] }
16-
opentelemetry = { version = "0.28", features = ["metrics"] }
17-
opentelemetry_sdk = { version = "0.28", features = ["metrics", "rt-tokio"] }
18-
opentelemetry-prometheus = { version = "0.28" }
19-
prometheus = { version = "0.13.4", features = ["process"] }
20-
tokio = { workspace = true, features = ["full"] }
21-
godfig = { workspace = true }
22-
serde = { workspace = true, features = ["derive"] }
15+
aptos-logger = { git = "https://github.com/movementlabsxyz/aptos-core.git", branch = "movement" }
16+
aptos-telemetry = { git = "https://github.com/movementlabsxyz/aptos-core.git", branch = "movement" }
17+
aptos-types = { git = "https://github.com/movementlabsxyz/aptos-core.git", branch = "movement" }
18+
aptos-config = { git = "https://github.com/movementlabsxyz/aptos-core.git", branch = "movement" }
19+
aptos-crypto = { git = "https://github.com/movementlabsxyz/aptos-core.git", branch = "movement" }
20+
movement-config = { workspace = true }
21+
dot-movement = { workspace = true }
22+
once_cell = { workspace = true }
23+
tokio = { workspace = true }
24+
hex = { workspace = true }
25+
rand = { workspace = true }
26+
ring = "0.17.7"
27+
warp = "0.3"
28+
prometheus = "0.13"
29+
clap = { workspace = true }
30+
lazy_static = "1.4.0"
2331

2432
[lints]
2533
workspace = true

0 commit comments

Comments
 (0)