Download the PHP package preprio/opsgenie without Composer
On this page you can find all versions of the php package preprio/opsgenie. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package opsgenie
Prepr Laravel Opsgenie SDK
This SDK is used by the Prepr team to monitor Laravel projects in Atlassian Opsgenie.
Installation
Composer
Config
Publish opsgenie.php
config
Configuration
Update .env
file with the api access token (API_ACCESS_TOKEN) and service id (SERVICE_ID).
Example:
Optional configuration
Prefix
It's optional to add a prefix to the message that's send to Opsgenie, to clearify what service/repo. You can add a prefix by configuring the following line in your .env
file.
Examples:
config | result |
---|---|
PREFIX | [PREFIX] Message |
preprio/mutation.prepr.io | [preprio/mutation.prepr.io] MESSAGE |
mutation-api | [mutation-api] MESSAGE |
Default tags
It's optional to add default tags to the message that's send to Opsgenie. You can add a default tags by configuring the following line in your .env
file. (comma-separated list)
Docs OpsGenie
Usage
Base
For an incident
For an alert
Priority functions (required)
Set incident priority.
Priority | Function |
---|---|
Critical | ->P1() or ->critical() |
High | ->P2() or ->high() |
Moderate | ->P3() or ->moderate() |
Low | ->P4() or ->low() |
Informational | ->P5() or ->informational() |
Message (required)
Set incident title.
Description (optional)
Set incident description.
Details (optional)
Set incident details. (Key-Value list)
Tags (optional)
Set incident tags. (Simple list)
Send (required)
Send incident to Opsgenie.
Full example:
Function above combined.
Alert attachments
Attach Resource/Blob (optional)
You can add attachments to alerts like log files, exception files, renders, json, etc.
By adding the following function(s) after ->send()
.
You can also attach multiple files
Attach files (optional) ⚠️ NOT TESTED
Attach example/combined
You can use attach-function multiple times, and mix them in random order.
For example 2x ->attachBlob()
, 1x ->attachFile()
.