Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bin/network-monitor/.env
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
MIDEN_MONITOR_RPC_URL=http://0.0.0.0:57291
MIDEN_MONITOR_REMOTE_PROVER_URLS=https://tx-prover.devnet.miden.io/,https://batch-prover.devnet.miden.io/
MIDEN_MONITOR_PORT=3001
MIDEN_MONITOR_ENABLE_OTEL=true
1 change: 1 addition & 0 deletions bin/network-monitor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The monitor application uses environment variables for configuration:
- `MIDEN_MONITOR_RPC_URL`: RPC service URL (default: `http://localhost:50051`)
- `MIDEN_MONITOR_REMOTE_PROVER_URLS`: Comma-separated list of remote prover URLs (default: `http://localhost:50052`)
- `MIDEN_MONITOR_PORT`: Web server port (default: `3000`)
- `MIDEN_MONITOR_ENABLE_OTEL`: Enable OpenTelemetry tracing (default: `false`)

## Usage

Expand Down
12 changes: 11 additions & 1 deletion bin/network-monitor/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ use frontend::{ServerState, serve};
use status::{MonitorConfig, ServiceStatus, run_remote_prover_status_task, run_rpc_status_task};
use tracing::info;

use crate::status::ENABLE_OTEL_ENV_VAR;

/// Component identifier for structured logging and tracing
pub const COMPONENT: &str = "miden-network-monitor";

Expand All @@ -27,7 +29,15 @@ pub const COMPONENT: &str = "miden-network-monitor";
/// unexpectedly, the entire process exits.
#[tokio::main]
async fn main() -> anyhow::Result<()> {
miden_node_utils::logging::setup_tracing(OpenTelemetry::Disabled)?;
if std::env::var(ENABLE_OTEL_ENV_VAR)
.unwrap_or_default()
.parse::<bool>()
.unwrap_or_default()
{
miden_node_utils::logging::setup_tracing(OpenTelemetry::Enabled)?;
} else {
miden_node_utils::logging::setup_tracing(OpenTelemetry::Disabled)?;
}

// Load configuration from environment variables
let config = match MonitorConfig::from_env() {
Expand Down
1 change: 1 addition & 0 deletions bin/network-monitor/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const DEFAULT_PORT: u16 = 3000;
const RPC_URL_ENV_VAR: &str = "MIDEN_MONITOR_RPC_URL";
const REMOTE_PROVER_URLS_ENV_VAR: &str = "MIDEN_MONITOR_REMOTE_PROVER_URLS";
const PORT_ENV_VAR: &str = "MIDEN_MONITOR_PORT";
pub(crate) const ENABLE_OTEL_ENV_VAR: &str = "MIDEN_MONITOR_ENABLE_OTEL";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why we do not include this into the MonitorConfig struct?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ended up including it in another PR since this was already merged 👌🏼


/// Configuration for the monitor.
///
Expand Down