-
Notifications
You must be signed in to change notification settings - Fork 7
deps: upgrade to v1.11.0 #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
Changes from 1 commit
d0df493
7f81d43
19f05ea
ea60c7b
3955ea7
78f6a88
1f2fca9
e403e0d
a6fc14e
30edc9e
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; | ||||||||||||||||||
| } | ||||||||||||||||||
|
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(); | ||||||||||||||||||
| } | ||||||||||||||||||
|
chatton marked this conversation as resolved.
Outdated
|
||||||||||||||||||
|
|
||||||||||||||||||
| if let Err(err) = | ||||||||||||||||||
|
|
||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.