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

docs(webhook): Add webhook sink configuration docs #62

Merged
merged 1 commit into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`.