Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream Cirrus CI webhook events to DataDog #2

Merged
merged 10 commits into from
Jul 13, 2023
Prev Previous commit
Next Next commit
README.md: document DataDog processor
  • Loading branch information
edigaryev committed Jul 11, 2023
commit 77a3dda41d48e98a877f53a084fb705ab7907689
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
# Cirrus Webhooks Server

Example of a simple server that processes webhook events from the Cirrus CI.
Examples of the webhook event processors from the Cirrus CI.

## Processors

## DataDog
fkorotkov marked this conversation as resolved.
Show resolved Hide resolved

This processor receives, enriches and streams Cirrus CI webhook events to DataDog.

The simplest way to try this processor is to use Docker and [ngrok](https://ngrok.com/).

First, you'll need to run the DataDog agent locally. The easiest way to do that would probably be [a Docker container](https://docs.datadoghq.com/containers/docker/?tab=standard), just don't forget to expose the DogStatsD port by adding the following argument to `docker run`:

```
-p 8125:8125/udp
```

Then, run the DataDog processor:

```sh
docker run -it --rm -p 8080:8080 ghcr.io/cirruslabs/cirrus-webhooks-server:latest datadog --dogstatsd-addr=host.docker.internal:8125
```

Note the `--dogstatsd-addr=host.docker.internal:8125`, it shows the DataDog processor where to find the DogStatsD daemon. In this case, it's on the Docker's host machine.

Finally, [install](https://ngrok.com/download) and run `ngrok` to expose our DataDog processor's HTTP server to the internet:

```sh
ngrok http 8080
```

This will open the following TUI window:

![](docs/ngrok-http-8080.png)

You'll need to copy the forwarding address and set it in your organization's settings in the Cirrus CI app:

![](docs/cirrus-ci-webhook-settings.png)

Now you can run some tasks, and the corresponding audit events will appear shortly in your "Events Explorer":

![](docs/datadog-webhook-event.png)
Binary file added docs/cirrus-ci-webhook-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/datadog-webhook-event.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/ngrok-http-8080.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.