Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nsqio/nsqadmin_to_slack
NSQ consumer to relay nsqadmin actions to slack in realtime
https://github.com/nsqio/nsqadmin_to_slack
nsq nsqadmin slack
Last synced: 13 days ago
JSON representation
NSQ consumer to relay nsqadmin actions to slack in realtime
- Host: GitHub
- URL: https://github.com/nsqio/nsqadmin_to_slack
- Owner: nsqio
- License: mit
- Created: 2021-04-06T03:51:21.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-04-06T03:57:05.000Z (over 3 years ago)
- Last Synced: 2024-10-06T03:07:03.334Z (about 1 month ago)
- Topics: nsq, nsqadmin, slack
- Language: Go
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nsqadmin_to_slack
`nsqadmin_to_slack` sends event actions from nsqadmin to a slack channel. It's inspired by [nsqadmin2hipchat](https://github.com/danielhfrank/nsqadmin2hipchat) by [@danielhfrank](https://github.com/danielhfrank).
This was adapted from a more generic internal nofication system in use at Bitly.
### nsqadmin configuration
`nsqadmin` supports creating a datastream of events of state change actions. These events cover actions like pause/unpause/empty/remove for topics and channels.
To enable this event datastream configure `nsqadmin` to use the HTTP PUB endpoint on `nsqd`
```
nsqadmin --notification-http-endpoint="http://127.0.0.1:4151/pub?topic=nsqadmin_events"
```If HTTP requests to nqsadmin have a Basic authorization header (often from running behind an authenticating proxy like [oauth2_proxy](https://github.com/bitly/oauth2_proxy)) that will be recorded in the event as the User initiating action. If the header X-Forwarded-Email is set, that will be used to match to the right slack user.
The structure of these events is defined [here](https://github.com/nsqio/nsq/blob/master/nsqadmin/notify.go#L12-L23).
### Configuration
`nsqadmin_to_slack` supports reading nsqadmin events from a nsqd topic, and sending properly formatted events to slack.
```
Usage of ./nsqadmin_to_slack:
-channel string
NSQ channel (default "nsqadmin_to_slack")
-consumer-opt value
option to passthrough to nsq.Consumer (may be given multiple times, http://godoc.org/github.com/nsqio/go-nsq#Config)
-lookupd-http-address value
lookupd HTTP address (may be given multiple times)
-max-in-flight int
max number of messages to allow in flight (default 200)
-nsqd-tcp-address value
nsqd TCP address (may be given multiple times)
-slack-channel string
Slack channel. i.e. #test
-slack-token string
Slack API Token (may alternately be specified via SLACK_TOKEN environment variable)
-topic string
NSQ topic
-version
print version string
```