Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ThreeDotsLabs/event-driven-example
An example Event-Driven application in Go built with Watermill library.
https://github.com/ThreeDotsLabs/event-driven-example
docker-compose event-driven go golang grafana kafka prometheus rabbitmq watermill
Last synced: about 7 hours ago
JSON representation
An example Event-Driven application in Go built with Watermill library.
- Host: GitHub
- URL: https://github.com/ThreeDotsLabs/event-driven-example
- Owner: ThreeDotsLabs
- License: mit
- Created: 2019-02-21T10:32:06.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-11-19T18:46:53.000Z (about 1 year ago)
- Last Synced: 2024-11-15T21:49:36.300Z (5 days ago)
- Topics: docker-compose, event-driven, go, golang, grafana, kafka, prometheus, rabbitmq, watermill
- Language: Go
- Size: 34.2 KB
- Stars: 134
- Watchers: 7
- Forks: 27
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Event-Driven application example
This is an example Event-Driven application written in Go, using [Watermill](https://github.com/ThreeDotsLabs/watermill).
The projects aims to integrate incoming GitHub webhooks with Grafana and Slack, essentially adding annotations and
sending messages when a new commit is pushed. There are also simulated deployment messages sent over RabbitMQ to
demonstrate working with multiple event streams.![](https://threedots.tech/media/event-driven-applications/diagram.png)
An example result can look like this:
![](https://threedots.tech/media/event-driven-applications/grafana.png)
![](https://threedots.tech/media/event-driven-applications/slack.png)
## Running
If you'd like to integrate the example with your Slack workspace, copy `.env-example` to `.env` and fill in the
webhook URL in `SLACK_WEBHOOK_URL` variable.In addition to the application, the docker-compose environment consists of:
* **Kafka** and **ZooKeeper**
* **RabbitMQ**
* **Grafana**
* **Prometheus**The whole environment can be run with:
```bash
docker-compose up
```You can now configure your GitHub repository to send webhooks to the application (you need to expose port `8080` to the
external network first).Alternatively, you can run `./scripts/send-stub-webhook.sh` to send some stub webhooks.
Visit [localhost:3000/d/webhooks](http://localhost:3000/d/webhooks) to see annotations added in Grafana. Use
`admin:secret` as credentials.## Metrics
You can access the Watermill dashboard at [localhost:3000/d/watermill](http://localhost:3000/d/watermill). See what
changes when you send more webhooks over time.![](https://threedots.tech/media/event-driven-applications/metrics.png)
## What's next?
See [Watermill's documentation](https://watermill.io/) to learn more.