-
Notifications
You must be signed in to change notification settings - Fork 87
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
chore(bridge-withdrawer): change batch value metric to a histogram #2016
base: main
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,10 +9,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |
|
||
## [Unreleased] | ||
|
||
### Added | ||
|
||
- Histogram etric `batch_settled_value` now a histogram [#2016](https://github.com/astriaorg/astria/pull/2016). | ||
|
||
### Changed | ||
|
||
- Update `idna` dependency to resolve cargo audit warning [#1869](https://github.com/astriaorg/astria/pull/1869). | ||
|
||
### Removed | ||
|
||
- Metric `batch_total_settled_value` removed in favor of `batch_settled_value` [#2016](https://github.com/astriaorg/astria/pull/2016). | ||
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. Instead of adding & removed, should we put this under "changed"? 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. In the past I did that and we decided to do an add and remove. |
||
|
||
## [1.0.1] - 2024-11-01 | ||
|
||
### Changed | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ use std::{ | |
io::Write as _, | ||
mem, | ||
net::SocketAddr, | ||
sync::LazyLock, | ||
time::Duration, | ||
}; | ||
|
||
|
@@ -74,25 +73,6 @@ pub(crate) const DEFAULT_IBC_DENOM: &str = "transfer/channel-0/utia"; | |
pub(crate) const SEQUENCER_CHAIN_ID: &str = "test-sequencer"; | ||
const ASTRIA_ADDRESS_PREFIX: &str = "astria"; | ||
|
||
static TELEMETRY: LazyLock<()> = LazyLock::new(|| { | ||
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. Why is this removed? The change seems to have nothing to do with this change? 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. Can't pass the config into the function here. I can strip out the new functionality of having the label off the config to roll this back. |
||
if std::env::var_os("TEST_LOG").is_some() { | ||
let filter_directives = std::env::var("RUST_LOG").unwrap_or_else(|_| "info".into()); | ||
telemetry::configure() | ||
.set_no_otel(true) | ||
.set_stdout_writer(std::io::stdout) | ||
.set_pretty_print(true) | ||
.set_filter_directives(&filter_directives) | ||
.try_init::<Metrics>(&()) | ||
.unwrap(); | ||
} else { | ||
telemetry::configure() | ||
.set_no_otel(true) | ||
.set_stdout_writer(std::io::sink) | ||
.try_init::<Metrics>(&()) | ||
.unwrap(); | ||
} | ||
}); | ||
|
||
pub struct TestBridgeWithdrawer { | ||
/// The address of the public API server (health, ready). | ||
pub api_address: SocketAddr, | ||
|
@@ -251,7 +231,6 @@ impl TestBridgeWithdrawerConfig { | |
ethereum_config, | ||
asset_denom, | ||
} = self; | ||
LazyLock::force(&TELEMETRY); | ||
|
||
// sequencer signer key | ||
let keyfile = NamedTempFile::new().unwrap(); | ||
|
@@ -287,12 +266,28 @@ impl TestBridgeWithdrawerConfig { | |
metrics_http_listener_addr: String::new(), | ||
pretty_print: true, | ||
}; | ||
if std::env::var_os("TEST_LOG").is_some() { | ||
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. This is bad, we cannot do that. The reason why we had a lazylock is that the tracing subscriber sits at a global static mwmory location. The present change can cause tests to fail/panic. |
||
let filter_directives = std::env::var("RUST_LOG").unwrap_or_else(|_| "info".into()); | ||
telemetry::configure() | ||
.set_no_otel(true) | ||
.set_stdout_writer(std::io::stdout) | ||
.set_pretty_print(true) | ||
.set_filter_directives(&filter_directives) | ||
.try_init::<Metrics>(&config) | ||
.unwrap(); | ||
} else { | ||
telemetry::configure() | ||
.set_no_otel(true) | ||
.set_stdout_writer(std::io::sink) | ||
.try_init::<Metrics>(&config) | ||
.unwrap(); | ||
} | ||
|
||
info!(config = serde_json::to_string(&config).unwrap()); | ||
|
||
let (metrics, metrics_handle) = metrics::ConfigBuilder::new() | ||
.set_global_recorder(false) | ||
.build(&()) | ||
.build(&config) | ||
.unwrap(); | ||
let metrics = Box::leak(Box::new(metrics)); | ||
|
||
|
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.