Skip to content

Commit 9db3a1c

Browse files
committed
address comments
1 parent 1cdee4c commit 9db3a1c

File tree

3 files changed

+9
-20
lines changed

3 files changed

+9
-20
lines changed

config/config.sample.pythnet.toml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,3 @@ exporter.maximum_compute_unit_price_micro_lamports = 100000
7070
# Note that this doesn't affect the rate at which transactions are published:
7171
# this is soley a backwards-compatibility API feature.
7272
notify_price_sched_interval_duration = "400ms"
73-
74-
# Configuration for OpenTelemetry
75-
[opentelemetry]
76-
77-
# Timeout in seconds for the OpenTelemetry exporter
78-
exporter_timeout_secs = 3
79-
80-
# Endpoint URL for the OpenTelemetry exporter
81-
exporter_endpoint = "http://127.0.0.1:4317"

config/config.sample.pythtest.toml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,3 @@ exporter.compute_unit_price_micro_lamports = 1000
6060
# Note that this doesn't affect the rate at which transactions are published:
6161
# this is soley a backwards-compatibility API feature.
6262
notify_price_sched_interval_duration = "400ms"
63-
64-
# Configuration for OpenTelemetry
65-
[opentelemetry]
66-
67-
# Timeout in seconds for the OpenTelemetry exporter
68-
exporter_timeout_secs = 3
69-
70-
# Endpoint URL for the OpenTelemetry exporter
71-
exporter_endpoint = "http://127.0.0.1:4317"

src/bin/agent.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ use {
1616
path::PathBuf,
1717
time::Duration,
1818
},
19-
tracing_subscriber::prelude::*,
19+
tracing_subscriber::{
20+
prelude::*,
21+
EnvFilter,
22+
},
2023
};
2124

2225
#[derive(Parser, Debug)]
@@ -45,6 +48,8 @@ async fn main() -> Result<()> {
4548
// Parse config early for logging channel capacity
4649
let config = Config::new(args.config).context("Could not parse config")?;
4750

51+
let env_filter = EnvFilter::from_default_env();
52+
4853
// Initialize a Tracing Subscriber
4954
let fmt_layer = tracing_subscriber::fmt::layer()
5055
.with_file(false)
@@ -73,7 +78,9 @@ async fn main() -> Result<()> {
7378
// Set up the telemetry layer
7479
let telemetry = tracing_opentelemetry::layer().with_tracer(tracer);
7580

76-
let registry = tracing_subscriber::registry().with(telemetry);
81+
let registry = tracing_subscriber::registry()
82+
.with(telemetry)
83+
.with(env_filter);
7784

7885
// Use the compact formatter if we're in a terminal, otherwise use the JSON formatter.
7986
if std::io::stderr().is_terminal() {

0 commit comments

Comments
 (0)