[ 
https://issues.apache.org/jira/browse/EAGLE-550?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Zeng, Bryant closed EAGLE-550.
------------------------------
    Resolution: Fixed

> Add Alert publish implementation for Slack
> ------------------------------------------
>
>                 Key: EAGLE-550
>                 URL: https://issues.apache.org/jira/browse/EAGLE-550
>             Project: Eagle
>          Issue Type: New Feature
>            Reporter: Zeng, Bryant
>            Assignee: Zeng, Bryant
>
> Add one more publish implement (Slack) for Alert.
> How to implement
> 1. Here uses a lib "simple-slack-api" to connecting to Slack and publish 
> alert messages to Slack.
> 2. Add one more publisher of Slack which extends "AbstractPublishPlugin" to 
> process received AlertStreamEvent, and according to Slack config which 
> defined in publishment.json to send messages.
> How to use
> 1. Create a bot user in Slack, and remember its token.
> 2. Create some channels if you want send messages to if they do not exist.
> 3. Add your bot user to these channels.
> 4. Then define Slack config and declare to use Slack publisher in config file 
> such as below (Especially the "type" and "properties". Here urltemplate will 
> form an output url link based on docId if downstream have it.), we can use it 
> very easily:
>  {
>     "name": "test-slack-output",
>     "type": 
> "org.apache.eagle.alert.engine.publisher.impl.AlertSlackPublisher",
>     "policyIds": [
>       "switch_check"
>     ],
>     "properties": {
>       "token": "your token",
>       "channels": "your channel1, your channel2",
>       "severitys": "CRITICAL",
>       "urltemplate": "your template/?id=%s"
>     },
>     "dedupIntervalMin": "PT1M",
>     "dedupFields": [
>       "appname"
>     ],
>     "serializer": 
> "org.apache.eagle.alert.engine.publisher.impl.StringEventSerializer"
>   }
> Something about the metadata schema
> 1. token: your bot user token. 
> 2. channels: Slack channel names.
> 3. severitys: which severity level alert message you want to send to Slack. 
> Other level message will be skipped.
> 4. urltemplate: used to form an output url link based on docId if downstream 
> have it. A typical use case will be that downstream stored all the alerts in 
> Elasticsearch, so we can previously append an ES link in the slack message.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to