-
Notifications
You must be signed in to change notification settings - Fork 8
deps: upgrade to v1.10.1 #106
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -11,25 +11,53 @@ use evolve_ev_reth::{ | |||||||||||||||||
| rpc::txpool::{EvolveTxpoolApiImpl, EvolveTxpoolApiServer}, | ||||||||||||||||||
| }; | ||||||||||||||||||
| use reth_ethereum_cli::Cli; | ||||||||||||||||||
| use reth_tracing_otlp::layer as otlp_layer; | ||||||||||||||||||
| use reth_tracing_otlp::{OtlpConfig, OtlpProtocol}; | ||||||||||||||||||
| use tracing::info; | ||||||||||||||||||
| use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilter}; | ||||||||||||||||||
| use url::Url; | ||||||||||||||||||
|
|
||||||||||||||||||
| use ev_node::{log_startup, EvolveArgs, EvolveChainSpecParser, EvolveNode}; | ||||||||||||||||||
|
|
||||||||||||||||||
| #[global_allocator] | ||||||||||||||||||
| static ALLOC: reth_cli_util::allocator::Allocator = reth_cli_util::allocator::new_allocator(); | ||||||||||||||||||
|
|
||||||||||||||||||
| /// Initialize reth OTLP tracing | ||||||||||||||||||
| fn init_otlp_tracing() { | ||||||||||||||||||
| // Set up tracing subscriber with reth OTLP layer | ||||||||||||||||||
| tracing_subscriber::registry() | ||||||||||||||||||
| /// Builds OTLP config from environment variables. | ||||||||||||||||||
| /// Returns None if OTLP is disabled or endpoint is not configured. | ||||||||||||||||||
| fn otlp_config_from_env() -> Option<OtlpConfig> { | ||||||||||||||||||
| // disabled if OTEL_SDK_DISABLED is set to anything other than "false" | ||||||||||||||||||
| if std::env::var("OTEL_SDK_DISABLED").is_ok_and(|v| v != "false") { | ||||||||||||||||||
| return None; | ||||||||||||||||||
| } | ||||||||||||||||||
|
Comment on lines
+27
to
+30
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current implementation for checking
Suggested change
|
||||||||||||||||||
|
|
||||||||||||||||||
| let endpoint = std::env::var("OTEL_EXPORTER_OTLP_ENDPOINT").ok()?; | ||||||||||||||||||
| let endpoint_url = Url::parse(&endpoint).ok()?; | ||||||||||||||||||
|
|
||||||||||||||||||
| let protocol = match std::env::var("OTEL_EXPORTER_OTLP_PROTOCOL") | ||||||||||||||||||
| .unwrap_or_else(|_| "http".to_string()) | ||||||||||||||||||
| .as_str() | ||||||||||||||||||
| { | ||||||||||||||||||
| "grpc" => OtlpProtocol::Grpc, | ||||||||||||||||||
| _ => OtlpProtocol::Http, | ||||||||||||||||||
| }; | ||||||||||||||||||
|
|
||||||||||||||||||
| OtlpConfig::new("ev-reth", endpoint_url, protocol, None).ok() | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| /// Initialize tracing with optional OTLP support. | ||||||||||||||||||
| fn init_tracing() { | ||||||||||||||||||
| let registry = tracing_subscriber::registry() | ||||||||||||||||||
| .with(EnvFilter::try_from_default_env().unwrap_or_else(|_| "info".into())) | ||||||||||||||||||
| .with(tracing_subscriber::fmt::layer().with_target(false)) | ||||||||||||||||||
| .with(otlp_layer("ev-reth")) | ||||||||||||||||||
| .init(); | ||||||||||||||||||
| .with(tracing_subscriber::fmt::layer().with_target(false)); | ||||||||||||||||||
|
|
||||||||||||||||||
| if let Some(config) = otlp_config_from_env() { | ||||||||||||||||||
| if let Ok(otlp_layer) = reth_tracing_otlp::span_layer(config) { | ||||||||||||||||||
| registry.with(otlp_layer).init(); | ||||||||||||||||||
| info!("OTLP tracing initialized for service: ev-reth"); | ||||||||||||||||||
| return; | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| info!("Reth OTLP tracing initialized for service: ev-reth"); | ||||||||||||||||||
| registry.init(); | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| fn main() { | ||||||||||||||||||
|
|
@@ -44,7 +72,7 @@ fn main() { | |||||||||||||||||
|
|
||||||||||||||||||
| // Initialize OTLP tracing | ||||||||||||||||||
| if std::env::var("OTEL_SDK_DISABLED").as_deref() == Ok("false") { | ||||||||||||||||||
| init_otlp_tracing(); | ||||||||||||||||||
| init_tracing(); | ||||||||||||||||||
| } | ||||||||||||||||||
|
Comment on lines
74
to
76
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The init_tracing(); |
||||||||||||||||||
|
|
||||||||||||||||||
| if let Err(err) = | ||||||||||||||||||
|
|
||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment indicates that reth v1.8.4 is being used, but the dependencies have been upgraded to v1.10.1. Please update the comment to reflect the new version for better maintainability.