Skip to content
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

[maas] Update MAAS plugin to collect logs for version 3.5+ #3340

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

brigaccess
Copy link

In MAAS 3.5, multiple services are introduced, and supervisor is replaced by Pebble in snap. This PR updates the maas plugin to collect the logs for new services.


Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines

  • Is the commit message split over multiple lines and hard-wrapped at 72 characters?
  • Is the subject and message clear and concise?
  • Does the subject start with [plugin_name] if submitting a plugin patch or a [section_name] if part of the core sosreport code?
  • Does the commit contain a Signed-off-by: First Lastname [email protected]?
  • Are any related Issues or existing PRs properly referenced via a Closes (Issue) or Resolved (PR) line?

@packit-as-a-service
Copy link

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/sosreport-sos-3340
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

@@ -62,13 +68,25 @@ def _is_snap_installed(self):
return maas_pkg['pkg_manager'] == 'snap'
return False

def check_enabled(self):
return super().check_enabled() or self.is_service("snap.maas.pebble")
Copy link
Member

Choose a reason for hiding this comment

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

if the maas snap is there, then the packages tuple will cover this already, so we shouldn't need the extra check here. The packages tuple checks or both debs and snaps for Ubuntu platforms

Copy link
Author

Choose a reason for hiding this comment

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

Awesome, thanks! I added a commit with a fix, should I squash it?

Copy link
Member

Choose a reason for hiding this comment

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

yes please, squash the commits

In MAAS 3.5, system journal is used by all the services, therefore the
log size is significantly increased compared to the previous MAAS
versions. For snap this means that `journalctl` might need a long time
to collect and filter the log files before outputting them.

This sometimes leads to `maas` plugin timeouts with 3.5 snap, as `sos`
performs automatic log collection for services listed in `services`
tuple without any filters other than unit name, unless explicitly
specified by user. We want the plugin to work without additional params,
so we service declaration for 3.5 snap is ommitted. Logs are collected
via `add_journal` call with a sane default limit to avoid timeouts.

Signed-off-by: Igor Brovtsin <[email protected]>
@TurboTurtle TurboTurtle merged commit d43b980 into sosreport:main Aug 25, 2023
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants