Skip to content

Add container support for server metrics recording. #463

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

Closed
wants to merge 2 commits into from

Conversation

mojowill
Copy link

@mojowill mojowill commented Jul 8, 2025

This includes detecting containerized environments and retrieving container-specific CPU and memory metrics. Test cases are added to verify functionality.

Bumped up against this when trying to use the Servers Recorder on a Laravel Cloud hosted application.

mojowill added 2 commits July 8, 2025 14:48
This includes detecting containerized environments and retrieving container-specific CPU and memory metrics. Test cases are added to verify functionality.
@timacdonald
Copy link
Member

@mojowill, appreciate the PR.

Right now, I'm not wanting to put Laravel Cloud specifics into Pulse, but I agree this could be useful for others.

If you were keen, it would be great to package this functionality up into a package. That way, Pulse users could install your package and register the callables via the existing Pulse hooks, e.g.,

use Laravel\Pulse\Recorders\Servers;
use Your\Package\CpuCheck;
use Your\Package\MemoryCheck;

Servers::detectCpuUsing(new CpuCheck);
Servers::detectMemoryUsing(new MemoryCheck);

Those classes would be callable, e.g., use an __invoke method as the entry point to computing the CPU and memory usage, and contain the logic you have in the PR.

Thanks again.

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.

2 participants