Skip to main content

· 6 min read
Alexis Fraudita
Ronald Pereira
Wilson Velasco

We present version 1.2.0 of the MoonGuard Filament Plugin! With this new update, we have added functionality to monitor the performance and health of your applications in production.

This functionality allows tracking of key indicators such as CPU load, RAM usage, and hard disk storage space.

This monitoring feature is crucial to ensure the efficiency and stability of your applications in production, allowing you to identify potential bottlenecks in performance and take corrective measures before they affect your users.

· 4 min read
Alexis Fraudita

Since the last release of the MoonGuard Filament Plugin, we have been searching for new features to enhance the experience of supporting and monitoring Laravel applications in the cloud. One of the issues we encountered was the ability to monitor hardware variables of the servers, such as CPU and RAM usage, as well as disk storage space. These variables provide us with information about our servers, allowing us to optimize our application and prevent critical failures. We have conducted research on how to monitor these variables with PHP and would like to share it in this article.

· 3 min read
Ronald Pereira

Over the past few weeks, we've been working on strengthening Krater's DB Query Analyzer, completing another iteration in which we've managed to scan the structures of the tables involved in the queries as well as resolving various bugs. In this article, we're going to review each of the changes in this new release!

· 3 min read
Wilson Velasco
Alexis Fraudita

Looking to improve the user experience of MoonGuard Filament Plugin, we realized that the only way to know when a site is under maintenance is by reviewing its configuration, which motivated us to add an indicator in the "sites stats" of the dashboard, we also contemplated that there was no mechanism that would allow us to eliminate very old exceptions in the database, those that occurred a long time ago and that we could consider as irrelevant information.

In this article we will explore how we add the functionality.

Adding maintenance indicator

Normally we use these site stats to visualize the uptime, ssl-certificate and number of exceptions that our sites have, so we had the idea to improve this by adding an indicator of when the sites are under maintenance.

on-maintenance-1.png

To achieve this, we update our Filament widget site-stats-widget.blade.php by adding a conditional that is executed when there is a date of the down_for_maintenance_at property of the site model.

on-maintenance-2.png

We also updated the widget components uptime-list-item.blade.php, performance-list-item.blade.php and certificate-list- item.blade.php so that they are not activated when in maintenance in order not to confuse us and improve the user experience.

The final result was the following.

on-maintenance-3.png

These small details are what polish and improve the user experience using MoonGuard.

If you want to see more detailed code you can see the PR on Github.

Add command to clean exceptions

We have a productive MoonGuard in which we have been testing its functionalities for the last 2-3 months with real projects and we realized that we needed a way to clean (automatically) very old exceptions that were no longer relevant, so we decided to create a new command and schedule it in the server scheduler to run periodically.

We created the command DeleteOldExceptionCommand , where all those exceptions that are older than the time specified in the MoonGuard configuration are deleted periodically:

  class Kernel extends ConsoleKernel
{
protected function schedule(Schedule $schedule)
{
$schedule->command(DeleteOldExceptionCommand::class)->everyMinute();
}

//...
}

This command works similar to the other MoonGuard commands (The CheckUptimeCommand and CheckSslCertificateCommand) you can schedule the execution of this command or use the MoonGuardCommandsScheduler if you want to schedule these three commands:

protected function schedule(Schedule $schedule): void
{
MoonGuardCommandsScheduler::scheduleMoonGuardCommands(
$schedule,
'* * * * *', // <-- Uptime Check Cron
'* * * * *', //<-- SSL Certificate Check Cron
'* * * * *' //<-- [Optional] Delete Exceptions Cron
);
}

For more information on programming these commands you can visit the MoonGuard documentation.

You can also read in detail the related changes in this PR on GitHub.

If you want to learn more about MoonGuard Filament Plugin, we invite you to read our book MoonGuard: The Software Creator's Journey V2 where we talk in detail about how we created each of the MoonGuard features as a Filament v3 plugin.

If you want to learn more about MoonGuard you can visit the page, follow us on Twitter/X and join our discord community for more information.

· 2 min read
Alexis Fraudita

Since the last release of the MoonGuard Filament Plugin, we have been updating our tool to make it more useful for Laravel developers.

On this occasion, we realized within MoonGuard's internal Slack channel that we were not receiving notifications for exceptions from different team projects, and we were also receiving duplicate notifications for uptime and SSL-certificate.

In this post, we want to tell you how we solved these issues and what we learned.

· 2 min read
Alexis Fraudita

In previous versions of the MoonGuard Filament Plugin, the team used Slack notifications to monitor different internal applications and test features of the MoonGuard package. However, these notifications were configured to be sent repeatedly to the same channel for each registered user, which presented a problem.