Skip to content

[sled-diagnostics] want chrony logs in support bundles #8530

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

Open
wants to merge 1 commit into
base: spr/papertigers/main.sled-diagnostics-want-chrony-logs-in-support-bundles
Choose a base branch
from
Open
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
21 changes: 21 additions & 0 deletions sled-diagnostics/src/logs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,27 @@ impl LogsHandle {
}
}
}

// Include the chrony logs found in "/var/log/chrony".
// These currently include:
// - measurements.log
// - statistics.log
// - tracking.log
//
// TODO: Once omicron#4728 is picked up we will need to handle the
// rotation and sorting of these files.
if service == "ntp" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Could we match on service, to make it clear this is basically the same thing we're doing with cockroachdb above?
  • How much of this is "NTP-specific"? E.g., why not grab service_logs.extra as a catch-all for all services?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does match on the service being ntp, but I will add the filter to make sure we are only grabbing those files for now.

I have been treating things in extra as a case by case basis. For example the log file names in cockroachdb look very different from the log names of chrony.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean we could do:

match service {
  "cockroachdb" => ...
  "ntp" => ...
  _ => ...
}

Which we are not doing; we are using two separate "if" statements

My question is, for the following logic:

                for log in service_logs.extra {
                    self.process_logs(
                        &service,
                        &mut zip,
                        &mut log_snapshots,
                        log.path.as_path(),
                        LogType::Extra,
                    )
                    .await?;
                }

What about this is "NTP-specific"? This seems like a generic way to "grab all extra logs", and could be the default thing we do for services

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yea totally -- will get something pushed to make that generic with some extra comments.

for log in service_logs.extra {
self.process_logs(
&service,
&mut zip,
&mut log_snapshots,
log.path.as_path(),
LogType::Extra,
)
.await?;
}
}
}

zip.finish()?;
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.