Skip to content

Commit

Permalink
docs(webhook): Add webhook sink configuration docs (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega authored Jan 13, 2022
1 parent 565ca22 commit bec75fc
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions book/src/sinks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ These are the existing sinks that are included as part the main _Oura_ codebase:
- [Terminal](terminal.md): a sink that outputs events into stdout with fancy coloring
- [Kakfa](kafka.md): a sink that sends each event into a Kafka topic
- [Elasticsearch](elastic.md): a sink that writes events into an Elasticsearch index or data stream.
- [Webhook](webhook.md): a sink that outputs each event as an HTTP call to a remote endpoint.

New sinks are being developed, information will be added in this documentation to reflect the updated list. Contributions and feature request are welcome in our [Github Repo](https://github.com/txpipe/oura).
33 changes: 33 additions & 0 deletions book/src/sinks/webhook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Webhook

A sink that outputs each event as an HTTP call to a remote endpoint. Each event is json-encoded and sent as the body of a request using `POST` method.

The sink expect a 200 reponse code for each HTTP call. If found, the process will continue with the next message. If an error occurs (either at the tcp or http level), the sink will apply the corresponding retry logic as specified in the configuration.

## Configuration

```toml
[sink]
type = "Webhook"
url = "https://endpoint:5000/events"
authorization = "user:pass"
timeout = 30000
error_policy = "Retry"
max_retries = 30
backoff_delay = 5000

[sink.headers]
extra_header_1 = "abc"
extra_header_2 = "123"
```

### Section: `sink`

- `type`: the literal value `Webhook`.
- `url`: url of your remote endpoint (needs to accept POST method)
- `authorization` (optional): value to add as the 'Authorization' HTTP header
- `headers` (optional): key-value map of extra headers to pass in each HTTP call
- `timeout` (optional): the timeout value for the HTTP response in milliseconds. Default value is `30000`.
- `error_policy` (optional): either `Continue` or `Retry`. Default value is `Retry`.
- `max_retries` (optional): the max number of retries before failing the whole pipeline. Default value is `30`
- `backoff_delay` (optional): the delay expressed in milliseconds between each retry. Default value is `5000`.

0 comments on commit bec75fc

Please sign in to comment.