mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-06-19 10:01:09 +00:00
Expose node's IP address via feed (#491)
* Fix typos Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * core: Extend `feed::LocatedNode` message with optional IP address Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * core: Expose IpAddr from locator task Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * core: Expose CLI flag to handle IP Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * tests: Consider Option<String> for IP address Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * core: Add node's IP directly to the Node's details Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Adjust testing and serialize node's ip address Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * frontend: Propagate IP address for deserialization purposes Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * core: Clarify the CLI flag documentation Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This commit is contained in:
@@ -105,7 +105,7 @@ impl Aggregator {
|
||||
pub async fn spawn(telemetry_uri: http::Uri) -> anyhow::Result<Aggregator> {
|
||||
let (tx_to_aggregator, rx_from_external) = flume::bounded(10);
|
||||
|
||||
// Establish a resiliant connection to the core (this retries as needed):
|
||||
// Establish a resilient connection to the core (this retries as needed):
|
||||
let (tx_to_telemetry_core, rx_from_telemetry_core) =
|
||||
create_ws_connection_to_core(telemetry_uri).await;
|
||||
|
||||
|
||||
@@ -248,6 +248,7 @@ pub struct NodeDetails {
|
||||
pub target_arch: Option<Box<str>>,
|
||||
pub target_env: Option<Box<str>>,
|
||||
pub sysinfo: Option<NodeSysInfo>,
|
||||
pub ip: Option<Box<str>>,
|
||||
}
|
||||
|
||||
impl From<NodeDetails> for node_types::NodeDetails {
|
||||
@@ -280,6 +281,7 @@ impl From<NodeDetails> for node_types::NodeDetails {
|
||||
target_arch: details.target_arch,
|
||||
target_env: details.target_env,
|
||||
sysinfo: details.sysinfo.map(|sysinfo| sysinfo.into()),
|
||||
ip: details.ip,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ where
|
||||
let mut stale_interval = tokio::time::interval(stale_node_timeout / 2);
|
||||
|
||||
// Our main select loop atomically receives and handles telemetry messages from the node,
|
||||
// and periodically checks for stale connections to keep our ndoe state tidy.
|
||||
// and periodically checks for stale connections to keep our node state tidy.
|
||||
loop {
|
||||
tokio::select! {
|
||||
// We periodically check for stale message IDs and remove nodes associated with
|
||||
|
||||
Reference in New Issue
Block a user