PHPackages                             santiripper/watchtower - 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. santiripper/watchtower

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

santiripper/watchtower
======================

Watchtower is a Laravel wrapper for sending custom metrics to Amazon AWS CloudWatch in a really pleasant &amp; powerful way.

35.3k1PHP

Since Jun 9Pushed 9y agoCompare

[ Source](https://github.com/santiripper/watchtower)[ Packagist](https://packagist.org/packages/santiripper/watchtower)[ RSS](/packages/santiripper-watchtower/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Watchtower
==========

[](#watchtower)

![Packagist](https://camo.githubusercontent.com/bfb16ccaa46eea7e628b7aed78a7e713c973f111d7d5c4f0b24b00bb3fc1ed27/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73616e74697269707065722f7761746368746f7765722e737667)![Packagist](https://camo.githubusercontent.com/39cdcf2115fdf2f1fe3cf179c2614739d79a67a532199f810c2fbcad8112832c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f73616e74697269707065722f7761746368746f7765722e737667)

Watchtower is a Laravel wrapper for sending custom metrics to Amazon AWS CloudWatch in a really pleasant &amp; powerful way.

Be sure to read the [CloudWatch docs](http://docs.aws.amazon.com/aws-sdk-php/v2/guide/service-cloudwatch.html) first.

Requirements
============

[](#requirements)

- PHP &gt;= 5.6
- Laravel &gt;= 5.1
- [Laravel AWS SDK](https://github.com/aws/aws-sdk-php-laravel) &gt;= 3
- An [Amazon AWS Cloudwatch](http://aws.amazon.com/cloudwatch) account

Installation
============

[](#installation)

Via Composer by running

```
composer require santiripper/watchtower

```

Or editing composer.json

```
{
    "require": {
        "santiripper/watchtower" : "dev-master"
    }
}
```

To use the Watchtower Service Provider, you must register the provider when bootstrapping your Laravel application.

Find the providers key in your `config/app.php` and register the Watchtower Service Provider.

```
'providers' => array(
    // ...
    Santiripper\Watchtower\WatchtowerServiceProvider::class,
)
```

Optional, find the aliases key in your `config/app.php` and register the Watchtower Service Provider.

```
'aliases' => array(
    // ...
    'Watchtower' => Santiripper\Watchtower\Facade::class`
)
```

Configuration
=============

[](#configuration)

Publish the config file by running

```
php artisan vendor:publish --tag=watchtower
```

It will create the file `app/config/watchtower.php`

Be sure to configure the [Laravel AWS PHP SDK](https://github.com/aws/aws-sdk-php-laravel) properly (regions &amp; credentials)

Usage
=====

[](#usage)

You can usage it via helper function

```
cloudwatch()->on(...);
```

Or by facade

```
Cloudwatch::on(...);
```

Namespaces
----------

[](#namespaces)

Watchtower supports multiple Cloudwatch namespaces. To select the namespace of the metric you have to specify it using the method `on`, for ex if our namespace is called `AwesomeApp`:

```
$awesomeApp = cloudwatch()->on('AwesomeApp');
```

Facade way:

```
$awesomeApp = Cloudwatch::on('AwesomeApp');
```

Also you can use the helper shortcut by passing the metric namespace as parameter to the main function:

```
$awesomeApp = cloudwatch('AwesomeApp');
```

Adding metrics
--------------

[](#adding-metrics)

```
$dimensions = [
    cloudwatch()->dimension('NameDimension1', 'ValueDimension2'),
    cloudwatch()->dimension('NameDimension1', 'ValueDimension2'),
];
$awesomeApp->newMetric('MetricName', 14, 'Count', $dimensions);
```

Setting default dimensions
--------------------------

[](#setting-default-dimensions)

You can configure default metric dimensions on namespaces that will be included on all related metrics.

Programatically:

```
$dimension = watchtower()->dimension('name', 'value');
$awesomeApp->addDefaultDimension($dimension);
```

Or by config on the `conig/watchtower.php` file:

```
'default_dimensions' => [
    'on' => [
        //Namespace
        'AwesomeApp' => [
            ['name' => 'test_name_1', 'value' => 'test_value_2'],
            ['name' => 'test_name_2', 'value' => 'test_value_2'],
        ],
    ],
],
```

Sending
-------

[](#sending)

By defaults, watchtower queues metrics on memory and sends it automatically when the scripts shutdown. You can configure this behavior on the watchtower config.

If you need to send the metrics at the moment you can do it by executing the sent method:

```
cloudwatch()->send();
```

ToDo
====

[](#todo)

- Add StatisticValues support
- Add support to output to aws console
- Write tests

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/c14d268232743d64ae6cd9cd5536912d14ac38b5355e1b3c634097996c599dcc?d=identicon)[santiripper](/maintainers/santiripper)

---

Top Contributors

[![sonnysantino](https://avatars.githubusercontent.com/u/1275605?v=4)](https://github.com/sonnysantino "sonnysantino (2 commits)")

---

Tags

awscloudwatchcloudwatch-metricslaravel

### Embed Badge

![Health badge](/badges/santiripper-watchtower/health.svg)

```
[![Health](https://phpackages.com/badges/santiripper-watchtower/health.svg)](https://phpackages.com/packages/santiripper-watchtower)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B10.8k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1938.5M261](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2326.5M315](/packages/open-telemetry-sdk)[illuminated/console-logger

Logging and Notifications for Laravel Console Commands.

8676.7k](/packages/illuminated-console-logger)[relaxart/monolog-docker-handler

Docker handler for monolog

1442.6k](/packages/relaxart-monolog-docker-handler)

PHPackages © 2026

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