Skip to main content

superhooks plugin for supervisord

Project description

Superhooks

Superhooks is a supervisor "event listener" that sends events from processes that run under supervisor to predefined web hooks. When superhooks receives an event, it sends a message notification to a configured URL.

superhooks uses requests full-featured Python http requests library.

Installation

pip install superhooks

Command-Line Syntax

$ superhooks  -u http://localhost:8090/ -e STARTING,RUNNING,BACKOFF,STOPPING,FATAL,EXITED,STOPPED,UNKNOWN -d "a^b^^c^d" -H "p^q^^r^s" 

Options

-u URL, --url=http://localhost:8090/

Post the payload to the url with http POST

-d DATA, --data=a^b^^c^d post body data as key value pair items are separated by ^^ and key and values are separated by ^

-H HEADERS, --headers=p^q^^r^s request headers with as key value pair items are separated by ^^ and key and values are separated by ^

-e EVENTS, --event=EVENTS

The Supervisor Process State event(s) to listen for. It can be any, one of, or all of STARTING, RUNNING, BACKOFF, STOPPING, EXITED, STOPPED, UNKNOWN.

Configuration

An [eventlistener:x] section must be placed in supervisord.conf in order for superhooks to do its work. See the “Events” chapter in the Supervisor manual for more information about event listeners.

The following example assume that superhooks is on your system PATH.

[eventlistener:superhooks]
command=python /usr/local/bin/superhooks -u http://localhost:8090/ -e BACKOFF,FATAL,EXITED,UNKNOWN -d "a^b^^c^d" -H "p^q^^r^s"
events=PROCESS_STATE,TICK_60

The above configuration will produce following payload for an crashing process named envoy

from_state=STARTING&event_name=PROCESS_STATE_BACKOFF&c=d&process_name=envoy%3Aenvoy&a=b
POST / HTTP/1.1
Host: localhost:8090
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 84
Content-Type: application/x-www-form-urlencoded
P: q
R: s
User-Agent: python-requests/2.12.1

from_state=BACKOFF&event_name=PROCESS_STATE_FATAL&c=d&process_name=envoy%3Aenvoy&a=b

Notes

  • All the events will be buffered for 1 min and pushed to web hooks.

0.2 (2019-05-11)

  • Fixed Readme

0.1 (2019-05-11)

  • Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

superhooks-0.4.tar.gz (5.2 kB view details)

Uploaded Source

Built Distributions

superhooks-0.4-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

superhooks-0.4-py2-none-any.whl (8.0 kB view details)

Uploaded Python 2

File details

Details for the file superhooks-0.4.tar.gz.

File metadata

  • Download URL: superhooks-0.4.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for superhooks-0.4.tar.gz
Algorithm Hash digest
SHA256 582c516bdf6ed430b46678e094131bab3ab412f88a9c3dcf0ee81bb69c6d8cce
MD5 8a52fa989ba74406cb27b493820366de
BLAKE2b-256 80fbb32572602e3e373fd16adea11f918960a09472626b5c52342e322edb8e24

See more details on using hashes here.

File details

Details for the file superhooks-0.4-py3-none-any.whl.

File metadata

  • Download URL: superhooks-0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for superhooks-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1afc3171ec3fe572ad4eaaa0e6dd9504eab937fbf5fdabaad7c3be3365049e4c
MD5 c79fe38f41d32adfd60198613c5b58db
BLAKE2b-256 9ef16f115a71fabe47a36f4c09136a64c09c078dcd3b1595c56bd8310f0a6f28

See more details on using hashes here.

File details

Details for the file superhooks-0.4-py2-none-any.whl.

File metadata

  • Download URL: superhooks-0.4-py2-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for superhooks-0.4-py2-none-any.whl
Algorithm Hash digest
SHA256 f05e1d56617dfff8c7d7ae57f5cdd798312598504e87a5e0b6043dc3e02865b5
MD5 9a637b7f906436c7f9dccca9843bb265
BLAKE2b-256 4cfd901ea4f37af22ed7a8a607ddadb4586763219968176bb24a7ac9d4bf7c77

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page