Skip to content

Commit

Permalink
Merge branch 'main' into feature/limit-sysinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
nightkr committed Dec 16, 2024
2 parents 819ed55 + 9875895 commit c723ec0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

### Changed

- Downgraded DNS errors to warnings ([#17]).
- All output is now wrapped in a "containerdebug" span ([#18]).

[#17]: https://github.com/stackabletech/containerdebug/pull/17
[#18]: https://github.com/stackabletech/containerdebug/pull/18

## [0.1.0] - 2024-12-09

### Added
Expand Down
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ fn main() {
APP_NAME,
opts.tracing_target,
);

// Wrap *all* output in a span, to separate it from main app output.
let _span = tracing::error_span!("containerdebug").entered();

stackable_operator::utils::print_startup_string(
crate_description!(),
crate_version!(),
Expand All @@ -64,7 +68,6 @@ fn main() {
let system_information = SystemInformation::collect(&mut collect_ctx);

let serialized = serde_json::to_string_pretty(&system_information).unwrap();
// println!("{serialized}");
if let Some(output_path) = &opts.output {
std::fs::write(output_path, &serialized).unwrap();
}
Expand Down
12 changes: 6 additions & 6 deletions src/system_information/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ impl SystemNetworkInfo {
.into_iter()
.map(|ptr_record| ptr_record.to_utf8())
.collect();
tracing::info!(%ip, ?hostnames, "performed reverse lookup for IP");
tracing::info!(%ip, ?hostnames, "performed reverse DNS lookup for IP");
Some((ip, hostnames))
}
Err(error) => {
tracing::error!(
tracing::warn!(
%ip,
error = &error as &dyn std::error::Error,
"reverse lookup failed"
"reverse DNS lookup failed"
);
None
}
Expand All @@ -89,14 +89,14 @@ impl SystemNetworkInfo {
.filter_map(|hostname| match resolver.lookup_ip(hostname.clone()) {
Ok(result) => {
let ips = result.iter().collect();
tracing::info!(hostname, ?ips, "performed forward lookup for hostname");
tracing::info!(hostname, ?ips, "performed forward DNS lookup for hostname");
Some((hostname, ips))
}
Err(error) => {
tracing::error!(
tracing::warn!(
hostname,
error = &error as &dyn std::error::Error,
"forward lookup failed"
"forward DNS lookup failed"
);
None
}
Expand Down

0 comments on commit c723ec0

Please sign in to comment.