Skip to content
Closed
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
139 changes: 128 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ homepage = "https://github.com/base/tips"
repository = "https://github.com/base/tips"

[workspace]
members = ["crates/datastore", "crates/audit", "crates/ingress-rpc", "crates/maintenance", "crates/ingress-writer"]
members = ["crates/datastore", "crates/audit", "crates/ingress-rpc", "crates/maintenance", "crates/ingress-writer", "crates/common"]
resolver = "2"

[workspace.dependencies]
tips-datastore = { path = "crates/datastore" }
tips-audit = { path = "crates/audit" }
tips-maintenance = { path = "crates/maintenance" }
tips-ingress-writer = { path = "crates/ingress-writer" }
tips-common = { path = "crates/common" }

# Reth
reth = { git = "https://github.com/paradigmxyz/reth", tag = "v1.8.1" }
Expand All @@ -40,6 +41,18 @@ op-alloy-consensus = { version = "0.20.0", features = ["k256"] }
tokio = { version = "1.47.1", features = ["full"] }
tracing = "0.1.41"
tracing-subscriber = { version = "0.3.20", features = ["env-filter"] }
opentelemetry = { version = "0.28.0", features = ["trace"] }
opentelemetry-otlp = { version = "0.28.0", features = [
"http-proto",
"http-json",
"reqwest-client",
"trace",
"grpc-tonic",
] }
opentelemetry_sdk = { version = "0.28.0", features = ["rt-tokio"] }
opentelemetry-datadog = { version = "0.19.0", features = ["reqwest-client"] }
opentelemetry-semantic-conventions = "0.28.0"
tracing-opentelemetry = "0.29.0"
anyhow = "1.0.99"
clap = { version = "4.5.47", features = ["derive", "env"] }
url = "2.5.7"
Expand Down Expand Up @@ -72,3 +85,6 @@ backon = "1.5.2"
op-revm = { version = "10.1.0", default-features = false }
revm-context-interface = "10.2.0"
alloy-signer-local = "1.0.36"

reqwest = { version = "0.12", features = ["json"] }
opentelemetry-http = "0.31.0"
2 changes: 2 additions & 0 deletions crates/audit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ aws-config = { workspace = true }
aws-sdk-s3 = { workspace = true }
aws-credential-types = { workspace = true }
bytes = { workspace = true }
tips-common = { workspace = true }
tracing-opentelemetry.workspace = true

[dev-dependencies]
testcontainers = { workspace = true }
Expand Down
38 changes: 31 additions & 7 deletions crates/audit/src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use rdkafka::consumer::Consumer;
use tips_audit::{
KafkaMempoolArchiver, KafkaMempoolReader, S3EventReaderWriter, create_kafka_consumer,
};
use tips_common::init_tracing;
use tracing::{info, warn};
use tracing_opentelemetry::OpenTelemetryLayer;
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};

#[derive(Debug, Clone, ValueEnum)]
Expand Down Expand Up @@ -45,6 +47,16 @@ struct Args {

#[arg(long, env = "TIPS_AUDIT_S3_SECRET_ACCESS_KEY")]
s3_secret_access_key: Option<String>,

#[arg(long, env = "TIPS_AUDIT_TRACING_ENABLED", default_value = "false")]
tracing_enabled: bool,

#[arg(
long,
env = "TIPS_AUDIT_TRACING_OTLP_ENDPOINT",
default_value = "http://localhost:4317"
)]
tracing_otlp_endpoint: String,
}

#[tokio::main]
Expand All @@ -68,13 +80,25 @@ async fn main() -> Result<()> {
}
};

tracing_subscriber::registry()
.with(
tracing_subscriber::EnvFilter::try_from_default_env()
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new(log_level.to_string())),
)
.with(tracing_subscriber::fmt::layer())
.init();
if args.tracing_enabled {
let (trace_filter, tracer) = init_tracing(
env!("CARGO_PKG_NAME").to_string(),
env!("CARGO_PKG_VERSION").to_string(),
args.tracing_otlp_endpoint.clone(),
log_level.to_string(),
4317,
)?;

tracing_subscriber::registry()
.with(trace_filter)
.with(OpenTelemetryLayer::new(tracer))
.with(
tracing_subscriber::EnvFilter::try_from_default_env()
.unwrap_or_else(|_| tracing_subscriber::EnvFilter::new(log_level.to_string())),
)
.with(tracing_subscriber::fmt::layer())
.try_init()?;
}

info!(
kafka_properties_file = %args.kafka_properties_file,
Expand Down
Loading