lafourchette/pager-duty-bundle

此包最新版本(v0.1.2)没有可用的许可证信息。

从您的Symfony2应用程序中轻松触发PagerDuty事件。

v0.1.2 2015-04-23 15:18 UTC

This package is not auto-updated.

Last update: 2021-10-02 01:29:01 UTC


README

Build Status Code Coverage Scrutinizer Code Quality

从您的Symfony2应用程序中轻松触发PagerDuty事件。

一个简单的示例

在您的config.yml文件中

la_fourchette_pager_duty:
    services:
        my_service_alias: {key: "the 32 char GUID provided by PagerDuty"}

您可以在https://<your subdomain>.pagerduty.com/services找到服务GUID

然后,在代码中某个地方,发生了真正糟糕的事情

$event = $this->get('la_fourchette_pager_duty.factory.event')
    ->make("my_service_alias", "something bad happened");

// @throw PagerDuty\EventException if PagerDuty API 500s
$event->trigger();

LiipMonitor兼容性

如果您正在使用liip/monitor-bundle,您将获得一个“pagerduty”报告器,它会在失败时触发PagerDuty。您只需实现Check/PagerDutyCheckInterface

# Trigger pager duty on failed checks
app/console monitor:health --reporter=pagerduty

安装

首先,将PagerDutyBundle添加到您的composer.json中依赖项列表

{
    "require-dev": {
        "lafourchette/pager-duty-bundle": "~0.1"
    }
}

然后更新您的AppKernel.php

    public function registerBundles()
    {
        $bundles = array(
            ...
            new LaFourchette\PagerDutyBundle\LaFourchettePagerDutyBundle()
            ...
        );

        return $bundles;
    }