PHPackages                             picobaz/laravel-sentinel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. picobaz/laravel-sentinel

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

picobaz/laravel-sentinel
========================

Advanced monitoring and alerting system for Laravel applications with real-time notifications

1.3.3(5mo ago)513↓50%MITPHPPHP ^8.1

Since Nov 23Pushed 5mo agoCompare

[ Source](https://github.com/PicoBaz/laravel-sentinel)[ Packagist](https://packagist.org/packages/picobaz/laravel-sentinel)[ RSS](/packages/picobaz-laravel-sentinel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (9)Used By (0)

🛡️ Laravel Sentinel
===================

[](#️-laravel-sentinel)

Advanced monitoring and alerting system for Laravel applications with real-time notifications across multiple channels.

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)[![PHP](https://camo.githubusercontent.com/cc9cdea9aa96b40a822425e981b0a030e3371202973c7d57b74e8e99834f81dc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e312d626c7565)](https://camo.githubusercontent.com/cc9cdea9aa96b40a822425e981b0a030e3371202973c7d57b74e8e99834f81dc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e312d626c7565)[![Laravel](https://camo.githubusercontent.com/98b5b64b1789dbf3ac46406cf451b9a1c33500beab1840ca958d5a4fdb0eef9b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d25354531302e3025374325354531312e3025374325354531322e302d726564)](https://camo.githubusercontent.com/98b5b64b1789dbf3ac46406cf451b9a1c33500beab1840ca958d5a4fdb0eef9b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d25354531302e3025374325354531312e3025374325354531322e302d726564)

✨ Features
----------

[](#-features)

- 🔍 **Query Monitoring** - Detect and log slow database queries
- 💾 **Memory Monitoring** - Track memory usage and prevent leaks
- 🚨 **Exception Monitoring** - Catch and categorize exceptions
- ⚡ **Performance Monitoring** - Monitor response times
- 🔐 **Security Monitoring** - Track security threats and attacks
- 🤖 **AI Insights &amp; Predictions** - Machine learning powered analysis (v1.2.0)
- 💰 **Cost Optimizer** - Infrastructure cost analysis and optimization (NEW v1.3.0)
- 📊 **Beautiful Dashboard** - Real-time metrics visualization
- 🔔 **Multi-Channel Alerts** - Slack, Telegram, Discord, Email
- 🧩 **Modular Architecture** - Easily extend with custom modules
- ⚙️ **Smart Thresholds** - Configurable alert triggers
- 📈 **Analytics** - Detailed performance insights

📦 Installation
--------------

[](#-installation)

```
composer require picobaz/laravel-sentinel
```

### Setup

[](#setup)

```
# Install and run migrations
php artisan sentinel:install
```

This will:

- Publish configuration file to `config/sentinel.php`
- Publish views to `resources/views/vendor/sentinel`
- Run migrations automatically

### Manual Installation (if needed)

[](#manual-installation-if-needed)

If you prefer manual installation:

```
# Publish config
php artisan vendor:publish --tag=sentinel-config

# Publish views (optional)
php artisan vendor:publish --tag=sentinel-views

# Run migrations
php artisan migrate
```

### ⚠️ Troubleshooting

[](#️-troubleshooting)

If you encounter "Table sentinel\_logs doesn't exist" error:

```
# Make sure migrations ran
php artisan migrate

# If still having issues, check if table exists
php artisan tinker
>>> Schema::hasTable('sentinel_logs')

# Clear cache
php artisan config:clear
php artisan cache:clear
```

**Note:** Sentinel is designed to fail gracefully. If tables don't exist, it won't log anything until migrations are run.

⚙️ Configuration
----------------

[](#️-configuration)

Edit `config/sentinel.php`:

```
return [
    'enabled' => true,

    'modules' => [
        'queryMonitor' => true,
        'memoryMonitor' => true,
        'exceptionMonitor' => true,
        'performanceMonitor' => true,
    ],

    'thresholds' => [
        'query_time' => 1000,
        'memory_usage' => 128,
        'response_time' => 2000,
    ],

    'notifications' => [
        'channels' => [
            'telegram' => true,
            'slack' => false,
            'email' => true,
            'discord' => false,
        ],
    ],
];
```

### Environment Variables

[](#environment-variables)

```
SENTINEL_ENABLED=true

SENTINEL_QUERY_TIME_THRESHOLD=1000
SENTINEL_MEMORY_THRESHOLD=128
SENTINEL_RESPONSE_TIME_THRESHOLD=2000

SENTINEL_TELEGRAM_ENABLED=true
SENTINEL_TELEGRAM_BOT_TOKEN=your_bot_token
SENTINEL_TELEGRAM_CHAT_ID=your_chat_id

SENTINEL_SLACK_ENABLED=false
SENTINEL_SLACK_WEBHOOK=your_webhook_url

SENTINEL_EMAIL_ENABLED=true
SENTINEL_EMAIL_RECIPIENTS=admin@example.com,dev@example.com
```

🚀 Usage
-------

[](#-usage)

### Automatic Monitoring

[](#automatic-monitoring)

Sentinel automatically monitors your application once installed. All modules run in the background.

### Manual Logging

[](#manual-logging)

```
use PicoBaz\Sentinel\Facades\Sentinel;

Sentinel::log('custom', [
    'action' => 'user_login',
    'user_id' => 123,
    'ip' => request()->ip(),
]);
```

### Middleware

[](#middleware)

Add to specific routes:

```
Route::middleware(['sentinel'])->group(function () {
    Route::get('/dashboard', [DashboardController::class, 'index']);
});
```

### Dashboard

[](#dashboard)

Access the dashboard at: `http://your-app.test/sentinel`

### Artisan Commands

[](#artisan-commands)

```
php artisan sentinel:status
php artisan sentinel:security-report --hours=24
php artisan sentinel:ai-insights --refresh
php artisan sentinel:cost-optimizer --refresh
```

🤖 AI Insights &amp; Predictions (NEW in v1.2.0)
-----------------------------------------------

[](#-ai-insights--predictions-new-in-v120)

### Overview

[](#overview)

The AI Insights module uses machine learning algorithms to analyze your application's behavior and provide actionable insights:

**Capabilities:**

- 📊 Pattern recognition and analysis
- 🔍 Anomaly detection across all metrics
- 🔮 Performance predictions (24h and 7-day forecasts)
- 💡 Automated optimization recommendations
- ⚠️ Downtime risk assessment
- 📈 Trend analysis and forecasting

### Features

[](#features)

#### 1. Pattern Analysis

[](#1-pattern-analysis)

- **Peak Hours Detection** - Identifies when your app experiences highest load
- **Slow Endpoint Identification** - Automatically finds performance bottlenecks
- **Memory Trend Analysis** - Tracks memory usage patterns over time
- **Error Pattern Recognition** - Detects recurring errors and their frequency

#### 2. Anomaly Detection

[](#2-anomaly-detection)

Uses statistical analysis (Z-score) to detect unusual behavior:

- Response time anomalies
- Memory usage spikes
- Unusual error rates
- Query count anomalies

#### 3. Predictive Analytics

[](#3-predictive-analytics)

Machine learning predictions for:

- **Performance Trends** - Will your app get slower or faster?
- **Memory Usage** - Predict memory consumption for next 7 days
- **Error Rate Forecasting** - Anticipate error increases
- **Downtime Risk Scoring** - 0-100 risk score with severity levels

#### 4. Smart Recommendations

[](#4-smart-recommendations)

AI-generated actionable recommendations:

- Optimize slow endpoints
- Scale during peak hours
- Memory optimization suggestions
- Critical issue alerts

### Configuration

[](#configuration)

```
SENTINEL_AI_INSIGHTS=true
SENTINEL_AI_ANALYSIS_FREQUENCY=hourly
SENTINEL_AI_PREDICTION_WINDOW=24
SENTINEL_AI_ANOMALY_THRESHOLD=2.5
SENTINEL_AI_MIN_SAMPLES=20
```

### Usage

[](#usage)

#### View AI Insights

[](#view-ai-insights)

```
php artisan sentinel:ai-insights

# Refresh and view
php artisan sentinel:ai-insights --refresh
```

Output includes:

```
🏥 System Health
Score: 85/100 - Status: GOOD

⚠️  Anomalies Detected
  response_time: 3 anomalies
    Threshold: 2500ms | Max: 4200ms

🔮 Predictions
  📉 Performance: degrading
    Current: 1200ms | 24h: 1350ms | 7d: 1800ms

  ⬆️ Memory: increasing
    Current: 85MB | 24h: 92MB | 7d: 115MB

💡 AI Recommendations
  🚨 [critical] Memory Threshold Breach Predicted
    Memory usage is predicted to exceed threshold within 7 days
    → Investigate memory leaks and optimize memory-intensive operations

```

#### Programmatic Access

[](#programmatic-access)

```
use PicoBaz\Sentinel\Modules\AIInsights\AIInsightsHelper;

$healthScore = AIInsightsHelper::getHealthScore();

$predictions = AIInsightsHelper::getPredictions();

$anomalies = AIInsightsHelper::getAnomalies();

$recommendations = AIInsightsHelper::getRecommendations();

$summary = AIInsightsHelper::getInsightsSummary();

if (AIInsightsHelper::hasCriticalRecommendations()) {

}
```

#### Scheduling

[](#scheduling)

AI analysis runs automatically every hour. Customize in your `AppServiceProvider`:

```
use PicoBaz\Sentinel\Modules\AIInsights\AIInsightsModule;

$module = app(AIInsightsModule::class);
$module->analyzePatterns();
$module->detectAnomalies();
$module->generatePredictions();
$module->generateRecommendations();
```

### How It Works

[](#how-it-works)

#### Pattern Analysis Algorithm

[](#pattern-analysis-algorithm)

1. Collects logs from past 7 days
2. Groups data by time, endpoint, type
3. Calculates statistical distributions
4. Identifies significant patterns

#### Anomaly Detection (Z-Score)

[](#anomaly-detection-z-score)

```
Anomaly = |value - mean| > (threshold * standard_deviation)
Default threshold: 2.5 (captures 99% of normal data)

```

#### Trend Prediction (Linear Regression)

[](#trend-prediction-linear-regression)

```
Future Value = Current Average + (Trend * Time Period)
Trend = Slope calculated using least squares method

```

#### Health Score Calculation

[](#health-score-calculation)

```
Health Score = 100 - Downtime Risk - (Active Anomalies * 10)
Range: 0-100
Status: Excellent (80+) | Good (60+) | Fair (40+) | Poor (20+) | Critical (json(AIInsightsHelper::getInsightsSummary());
});
```

Response:

```
{
  "patterns": {
    "peak_hours": {"hours": [9, 10, 14], "peak_load": 1200},
    "slow_endpoints": {...}
  },
  "anomalies": {
    "response_time": {"detected": true, "count": 3}
  },
  "predictions": {
    "performance": {"trend": "degrading", "prediction_7d": 1800},
    "downtime_risk": {"level": "medium", "score": 45}
  },
  "recommendations": [...]
}
```

🔐 Security Monitoring
---------------------

[](#-security-monitoring)

### Features

[](#features-1)

The Security Monitor module tracks and prevents security threats:

- ✅ Failed login attempts
- ✅ SQL Injection attempts
- ✅ XSS (Cross-Site Scripting) attempts
- ✅ Path traversal attempts
- ✅ Command injection attempts
- ✅ Rate limiting violations
- ✅ Unauthorized access attempts
- ✅ File integrity monitoring
- ✅ IP blacklisting (manual &amp; automatic)
- ✅ Security scoring system

### Configuration

[](#configuration-1)

```
SENTINEL_SECURITY_MONITOR=true
SENTINEL_SECURITY_AUTO_BLOCK=true
SENTINEL_SECURITY_AUTO_BLOCK_SCORE=20
SENTINEL_SECURITY_BLACKLIST=192.168.1.100,10.0.0.5
```

### Middleware

[](#middleware-1)

Add security middleware to protect routes:

```
Route::middleware(['sentinel.security'])->group(function () {
    Route::get('/admin', [AdminController::class, 'index']);
});
```

### Security Helper

[](#security-helper)

```
use PicoBaz\Sentinel\Modules\SecurityMonitor\SecurityHelper;

SecurityHelper::getSecurityScore('192.168.1.1');

SecurityHelper::addToBlacklist('192.168.1.100', 'Multiple failed logins');

SecurityHelper::removeFromBlacklist('192.168.1.100');

SecurityHelper::isIpBlacklisted('192.168.1.100');

SecurityHelper::getThreatLevel(45);
```

### File Integrity Monitoring

[](#file-integrity-monitoring)

```
use PicoBaz\Sentinel\Modules\SecurityMonitor\SecurityMonitorModule;

$monitor = app(SecurityMonitorModule::class);
$monitor->checkFileIntegrity([
    base_path('.env'),
    base_path('composer.json'),
]);
```

### Security Report

[](#security-report)

Generate comprehensive security reports:

```
php artisan sentinel:security-report --hours=24
```

Output includes:

- Failed login attempts
- Suspicious requests by type
- Rate limiting violations
- Top threat IPs with security scores
- Blacklisted IPs

🧩 Creating Custom Modules
-------------------------

[](#-creating-custom-modules)

```
namespace App\Sentinel\Modules;

class CustomModule
{
    public function boot()
    {
        // Your monitoring logic
    }
}
```

Register in `config/sentinel.php`:

```
'modules' => [
    'customModule' => true,
],
```

📱 Notification Channels
-----------------------

[](#-notification-channels)

### Telegram

[](#telegram)

1. Create a bot via [@BotFather](https://t.me/botfather)
2. Get your chat ID from [@userinfobot](https://t.me/userinfobot)
3. Configure in `.env`

### Slack

[](#slack)

1. Create incoming webhook in Slack
2. Add webhook URL to `.env`

### Discord

[](#discord)

1. Create webhook in Discord server settings
2. Add webhook URL to `.env`

📊 Metrics API
-------------

[](#-metrics-api)

```
GET /sentinel/metrics/{type}?hours=24
```

Types: `query`, `memory`, `exception`, `performance`

Response:

```
[
    {
        "id": 1,
        "type": "query",
        "data": {...},
        "severity": "warning",
        "created_at": "2024-01-01 12:00:00"
    }
]
```

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

📝 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

👤 Author
--------

[](#-author)

**PicoBaz**

- Email:
- GitHub: [@PicoBaz](https://github.com/PicoBaz)
- Telegram: [@picobaz](https://t.me/picobaz)

🌟 Support
---------

[](#-support)

If you find this package helpful, please consider giving it a ⭐ on [GitHub](https://github.com/PicoBaz/laravel-sentinel)!

📚 Documentation
---------------

[](#-documentation)

For detailed documentation, visit [https://github.com/PicoBaz/laravel-sentinel/wiki](https://github.com/PicoBaz/laravel-sentinel)

🐛 Issues
--------

[](#-issues)

Report issues at

💰 Infrastructure Cost Optimizer (NEW in v1.3.0)
-----------------------------------------------

[](#-infrastructure-cost-optimizer-new-in-v130)

### Overview

[](#overview-1)

Optimize your infrastructure costs with AI-powered analysis and actionable recommendations. Track spending, identify waste, and save money while maintaining performance.

**Key Features:**

- 💻 Multi-Cloud Cost Analysis (AWS, DigitalOcean, Linode)
- 📊 Complete Cost Breakdown (Compute, Database, Storage, Network, Cache)
- 💡 Smart Optimization Recommendations
- 📈 ROI Calculator &amp; Payback Analysis
- ⚡ Efficiency Scoring (A-F Grade)
- 💰 Potential Savings Identification

### Quick Start

[](#quick-start)

```
# Analyze infrastructure costs
php artisan sentinel:cost-optimizer

# Force refresh analysis
php artisan sentinel:cost-optimizer --refresh
```

### Sample Output

[](#sample-output)

```
💰 Cost Overview
┌─────────────────────┬──────────┐
│ Metric              │ Value    │
├─────────────────────┼──────────┤
│ Monthly Cost        │ $152.50  │
│ Yearly Cost         │ $1,830.00│
│ Cost per 1K Requests│ $0.0234  │
└─────────────────────┴──────────┘

📊 Cost Breakdown
┌──────────┬──────────────┬───────┬──────────────┐
│ Category │ Monthly Cost │ Share │ Distribution │
├──────────┼──────────────┼───────┼──────────────┤
│ Compute  │ $60.00       │ 39.3% │ ████░░░░░░░░ │
│ Database │ $45.00       │ 29.5% │ ███░░░░░░░░░ │
│ Storage  │ $15.00       │ 9.8%  │ █░░░░░░░░░░░ │
│ Network  │ $30.00       │ 19.7% │ ██░░░░░░░░░░ │
│ Cache    │ $2.50        │ 1.6%  │ ░░░░░░░░░░░░ │
└──────────┴──────────────┴───────┴──────────────┘

⚡ Efficiency Score
Grade: B | Score: 82/100
Good! Some minor optimizations available.

💡 Optimization Recommendations
  ⚠️ [high] Database Query Optimization
    ⚡ Performance Gain: 40-80%
    → Review queries with: php artisan sentinel:query-report

  📌 [medium] Image Optimization
    💰 Savings: $12.00/month
    → Implement WebP format and lazy loading

💵 Total Potential Savings: $12.00/month ($144.00/year)

```

### Programmatic Usage

[](#programmatic-usage)

```
use PicoBaz\Sentinel\Modules\CostOptimizer\CostOptimizerHelper;

// Get total costs
$monthly = CostOptimizerHelper::getTotalMonthlyCost();
$yearly = CostOptimizerHelper::getTotalYearlyCost();

// Cost breakdown by category
$breakdown = CostOptimizerHelper::getCostBreakdown();
// Returns: ['compute' => 60.00, 'database' => 45.00, ...]

// Get potential savings
$savings = CostOptimizerHelper::getPotentialSavings();

// Efficiency metrics
$score = CostOptimizerHelper::getEfficiencyScore();  // 0-100
$grade = CostOptimizerHelper::getEfficiencyGrade();  // A, B, C, D, F

// Cost per request
$perRequest = CostOptimizerHelper::getCostPerRequest();

// ROI calculation
$roi = CostOptimizerHelper::calculateROI(1000);
// Returns: [
//   'annual_savings' => 144.00,
//   'implementation_cost' => 1000,
//   'payback_months' => 6.9,
//   'roi_percent' => -85.6,
//   'break_even_date' => '2025-07-15'
// ]

// Get all optimizations
$optimizations = CostOptimizerHelper::getOptimizations();
foreach ($optimizations as $opt) {
    echo "{$opt['title']}: Save \${$opt['savings']}/month\n";
}

// Get complete analysis
$analysis = CostOptimizerHelper::getCostAnalysis();
```

### Cost Analysis Features

[](#cost-analysis-features)

#### 1. Compute Cost Analysis

[](#1-compute-cost-analysis)

- Server utilization tracking
- Upsize/downsize recommendations
- Multi-instance cost aggregation
- Provider-specific pricing

#### 2. Database Cost Analysis

[](#2-database-cost-analysis)

- Query performance analysis
- Missing index detection
- Cache opportunity identification
- Optimization suggestions with performance impact

#### 3. Storage Cost Analysis

[](#3-storage-cost-analysis)

- Storage usage tracking
- Compression recommendations
- Lifecycle policy suggestions
- Cost per GB calculation

#### 4. Network/CDN Cost Analysis

[](#4-networkcdn-cost-analysis)

- Bandwidth usage tracking
- CDN hit rate optimization
- Image optimization recommendations
- Potential bandwidth reduction

#### 5. Cache Cost Analysis

[](#5-cache-cost-analysis)

- Cache effectiveness scoring
- ROI calculation
- Query caching opportunities
- Performance gain estimation

### Optimization Categories

[](#optimization-categories)

**Server Sizing:**

```
Utilization < 30% → Downgrade recommendation
Utilization > 80% → Upgrade recommendation
Utilization 30-80% → Optimal

```

**Database Optimizations:**

- Add missing indexes (0-90% speedup)
- Fix N+1 queries (40-80% speedup)
- Implement query caching (30-60% speedup)

**Network Optimizations:**

- Optimize CDN cache (potential 40% savings)
- Image format optimization (WebP)
- Lazy loading implementation

**Storage Optimizations:**

- Enable compression (30% savings)
- Lifecycle policies (20% savings)

### Configuration

[](#configuration-2)

Add to your `.env`:

```
SENTINEL_COST_OPTIMIZER=true

# Provider Configuration
SENTINEL_COST_PROVIDER=aws
SENTINEL_COST_INSTANCE_TYPE=t3.small
SENTINEL_COST_INSTANCE_COUNT=1

# Database
SENTINEL_COST_DB_PROVIDER=aws
SENTINEL_COST_DB_TYPE=rds.t3.small

# Storage
SENTINEL_COST_STORAGE_PROVIDER=aws
SENTINEL_COST_STORAGE_GB=100

# Network/CDN
SENTINEL_COST_CDN_PROVIDER=aws
SENTINEL_COST_BANDWIDTH_GB=500
SENTINEL_COST_CDN_HIT_RATE=70

# Cache
SENTINEL_COST_CACHE_PROVIDER=aws
SENTINEL_COST_CACHE_INSTANCE=cache.t3.micro

# Analysis
SENTINEL_COST_ANALYSIS_FREQUENCY=daily
```

### Supported Providers

[](#supported-providers)

**AWS:**

- EC2 instances (t3 family)
- RDS databases
- S3 storage
- CloudFront CDN
- ElastiCache

**DigitalOcean:**

- Droplets (Basic plans)
- Managed Databases
- Spaces storage

**Linode:**

- Compute instances
- All standard plans

### Real-World Examples

[](#real-world-examples-1)

#### Example 1: Over-Provisioned Server

[](#example-1-over-provisioned-server)

```
Analysis:
- Instance: t3.medium ($60/month)
- Utilization: 25%
- Recommendation: Downgrade to t3.small

Result:
💰 Savings: $30/month ($360/year)
⏱️ Implementation: 1 hour
Risk: Low

```

#### Example 2: Database Performance

[](#example-2-database-performance)

```
Analysis:
- Slow queries: 145
- Missing indexes: 12
- Avg query time: 850ms

Recommendations:
1. Add indexes (Performance: 70% faster)
2. Cache frequent queries (Load reduction: 60%)

Result:
⚡ Performance: 70% improvement
💰 Cost: $12.50/month (caching)
📊 ROI: 340%

```

#### Example 3: CDN Optimization

[](#example-3-cdn-optimization)

```
Analysis:
- Bandwidth: 2TB/month
- CDN Hit Rate: 55%
- Cost: $170/month

Recommendations:
- Optimize cache headers
- Enable WebP images
- Target hit rate: 85%

Result:
💰 Savings: $68/month ($816/year)
📈 Performance: 40% faster load times

```

### Efficiency Grading

[](#efficiency-grading)

```
Grade A (90-100): Excellent - Well optimized
Grade B (80-89):  Good - Minor improvements available
Grade C (70-79):  Fair - Consider optimizations
Grade D (60-69):  Poor - Optimization recommended
Grade F ( CostOptimizerHelper::getTotalMonthlyCost(),
        'breakdown' => CostOptimizerHelper::getCostBreakdown(),
        'efficiency' => CostOptimizerHelper::getEfficiencyScore(),
    ];
});

Route::get('/api/sentinel/costs/savings', function () {
    return [
        'potential_monthly' => CostOptimizerHelper::getPotentialSavings(),
        'potential_yearly' => CostOptimizerHelper::getPotentialSavings() * 12,
        'optimizations' => CostOptimizerHelper::getOptimizations(),
    ];
});
```

### Best Practices

[](#best-practices)

1. **Run Analysis Regularly**: Daily automated analysis catches cost drift
2. **Review Recommendations**: Prioritize high-impact, low-risk optimizations
3. **Track Changes**: Monitor cost trends after implementing optimizations
4. **Test Before Production**: Validate sizing changes in staging first
5. **Document Decisions**: Keep track of why certain recommendations were accepted/rejected

### Cost Savings Calculator

[](#cost-savings-calculator)

The module includes a sophisticated ROI calculator:

```
$roi = CostOptimizerHelper::calculateROI($implementationCost = 1000);

// Output:
[
    'annual_savings' => 144.00,
    'implementation_cost' => 1000,
    'payback_months' => 6.9,
    'roi_percent' => -85.6,  // Negative first year, positive after
    'break_even_date' => '2025-07-15'
]
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance72

Regular maintenance activity

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

8

Last Release

160d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/59c9ff1dfbbfe06642f32c2181c3b8af7e0bc190f3625d761f6199809b21b330?d=identicon)[PicoBaz](/maintainers/PicoBaz)

---

Top Contributors

[![PicoBaz](https://avatars.githubusercontent.com/u/89545937?v=4)](https://github.com/PicoBaz "PicoBaz (12 commits)")

---

Tags

aiapmapplication-monitoringdiscordexception-trackinglaravel-monitoringlaravel-packagelaravel-sentinelmemory-monitoringmonitoringnotificationsobservabilityperformanceperformance-monitoringprofilingquery-monitoringrealtime-alertsslacktelegramwebhook-notificationslaravelloggingmonitoringsecurityperformanceaimachine learningsentinelinfrastructurealertingpredictionscost-optimizationfinops

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/picobaz-laravel-sentinel/health.svg)

```
[![Health](https://phpackages.com/badges/picobaz-laravel-sentinel/health.svg)](https://phpackages.com/packages/picobaz-laravel-sentinel)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
