Technical Blog Post
Abstract
Map Prometheus cloud private events (or any event types) to Cloud Event Management
Body
Cloud Event Management provides DevOps (& Ops) teams with pre-configured event correlation, incident prioritization, notifications and runbooks (automated and manual) in a seamless experience suitable for any skill level. You can subscribe to Cloud Event Management here.
This blog outlines how to send events to Cloud Event Management using the Event Management sample application. If you have an event source that posts a JSON payload to a webhook, you can use the following example to ingest events into Cloud Event Management.
Our working example accepts Prometheus cloud private events. However, you can alter the mapping to accept other JSON formats. And if necessary, change the API endpoint name as well.
Public GitHub containing the Sample Application repository
Use this link to obtain the sample application: https://github.com/IBM-Bluemix/cloud-event-management-sample
Once you have the sample application repository in your GitHub, open and follow the instructions in the README.md file starting with "Running the app on Bluemix".
You will need to update the config.js and manifest.yml files as instructed. The Prometheus mapping is performed in the app.js file. The app.js file can be customized to support events of any format.
Once configured and bound to your Cloud Event Management service instance
Post your events to the following Restful API endpoint: https://{your_app_name}-imperative-moreness.mybluemix.net/api/prometheus
The URL shown is generated by Bluemix when any application is pushed, the resourcepath "/api/prometheus/ is set in app.js for our example.
In the README file, follow the "Using the app" step #2. Also, use the "Configure a webhook receiver" link to find out more about how to configure Prometheus.
Prometheus events are included in the sample repository in the sample-events folder.
To send Prometheus events manually issue the following commands
curl -H 'Content-Type: application/json' -X POST https://{your_app_name}-imperative-moreness.mybluemix.net/api/prometheus -d "$(cat ./sample-events/prometheus-firing.json)"
Or include the event JSON in the curl request as follows:
Incident Details view for the event sent above using the curl command:
What was demonstrated
For any JSON payload with some simple JSON mapping, you can convert events from any existing or custom source into the Cloud Event Management event format. Installing the publicly available sample application, enables you to configure and then send Prometheus cloud private events to Cloud Event Management.
Authors:
Adam Archambault
Phil Riedel
Sudhakar Chellam
UID
ibm11080045