Latest commit 044ed5d Dec 10, 2016
Failed to load latest commit information. Update Opsweekly README Dec 10, 2016
alerta.php api v4 now supports to-date param Feb 6, 2015
test.php add alerta oncall provider Jan 27, 2015

Opsweekly Integration

Opsweekly is a tool developed by Etsy to generate weekly oncall support reports.

For help, join Gitter chat


Copy the alerta.php file to providers/oncall or another path in the PHP include path and follow the configuration steps below.


Global Config:

  • base_url: The path to your Alerta API, e.g.
  • apikey: An API key created for Opsweekly in the Alerta console

Team Config:

  • alerta_search: The search filter that narrows down the results to the team. Variables: #logged_in_username# = The username of the person currently using opsweekly


Modify the config.php file similar to the following:

$oncall_providers = array(
    "alerta" => array(
        "display_name" => "Alerta",
        "lib" => "providers/oncall/alerta.php",
        "options" => array(
            "base_url" => "",
            "apikey" => "demo-key"
$teams = array(
    "" => array(
        "root_url" => "/opsweekly",
        "display_name" => "Ops",
        "email_report_to" => "",
        "database" => "opsweekly",
        "oncall" => array(
            "provider" => "alerta",
            "provider_options" => array(
                "alerta_search" => 'tags=watch:#logged_in_username#',
            "timezone" => "America/New_York",
            "start" => "friday 18:00",
            "end" => "friday 18:00",
        "weekly_hints" => array("jira", "github"),
        "irc_channel" => "#ops"


Returns 0 or more notifications as array()

  • Each notification should have the following keys:
    • time: alert 'createTime' attribute
    • hostname: alert 'environment' and 'resource' attributes
    • service: alert 'event' attribute
    • output: alert 'service' and 'text' attributes
    • state: alert 'severity' attribute eg. 'critical', 'major', 'minor', 'warning', 'normal'


To test, run:

$ php -f test.php



Copyright (c) 2015 Nick Satterly. Available under the MIT License.