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: Describe 'retry policy' mechanism #392

Merged
merged 2 commits into from
Aug 20, 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/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
- [Mapper Options](./advanced/mapper_options.md)
- [Intersect Options](./advanced/intersect_options.md)
- [Custom Network](./advanced/custom_network.md)
- [Retry Policy](./advanced/retry_policy.md)
- [Guides](./guides/README.md)
- [Cardano => Kafka](./guides/cardano_2_kafka.md)

3 changes: 2 additions & 1 deletion book/src/advanced/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ This section provides detailed information on the some of the advanced features
- [Pipeline Metrics](./pipeline_metrics.md): allows operators to track the progress and performance of long-running Oura sessions.
- [Mapper Options](./mapper_options.md): A set of "expensive" event mapping procedures that require an explicit opt-in to be activated.
- [Intersect Options](./intersect_options.md): Advanced options for instructing Oura from which point in the chain to start reading from.
- [Custom Network](./custom_network.md): Instructions on how to configure Oura for connecting to a custom network.
- [Custom Network](./custom_network.md): Instructions on how to configure Oura for connecting to a custom network.
- [Retry Policy](./retry_policy.md): Instructions on how to configure retry policies for different operations
1 change: 1 addition & 0 deletions book/src/advanced/retry_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Advanced options for instructing Oura how to deal with failed attempts in certai
- [GCP CloudFunction](../sinks/gcp_cloudfunction.md)
- [GCP PubSub](../sinks/gcp_pubsub.md)
- [Webhook](../sinks/webhook.md)
- [Elasticsearch](../sinks/elastic.md)

## Configuration

Expand Down
10 changes: 10 additions & 0 deletions book/src/sinks/elastic.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ password = "my very secret stuff"
- `type`: the literal value `Elastic`.
- `url`: the location of the Elasticsearch's API
- `index`: the name of the index (or data stream) to store the event documents
- `idempotency` (optional): flag that if enabled will force idempotent calls to ES (to avoid duplicates)
- `retry_policy` (optional): controls the policy to retry failed requests (see [retry policy](../advanced/retry_policy.md))

### Section: `sink.credentials`

Expand All @@ -31,3 +33,11 @@ We currently only implement _basic_ auth, other mechanisms will be implemented a
- `type`: the mechanism to use for authentication, only `Basic` is currently implemented
- `username`: username of the user with access to Elasticsearch
- `password`: password of the user with access to Elasticsearch

## Idempotency

In services and API calls, _idempotency_ refers to a property of the system where the execution of multiple "equivalent" requests have the same effect as a single request. In other words, "idempotent" calls can be triggered multiple times without problem.

In our Elasticsearch sink, when the `idempotency` flag is enabled, each document sent to the index will specify a particular content-based ID: the [fingerprint](../filters/fingerprint.md) of the event. If Oura restarts without having a cursor or if the same block is processed for any reason, repeated events will present the same ID and Elasticsearch will reject them and Oura will continue with the following event. This mechanism provides a strong guarantee that our index won't contain duplicate data.

If the flag is disabled, each document will be generated using a random ID, ensuring that it will be indexed regardless.
2 changes: 1 addition & 1 deletion book/src/sinks/webhook.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ extra_header_2 = "123"
- `allow_invalid_certs` (optional): a flag to skip TLS cert validation (usually for self-signed certs).
- `timeout` (optional): the timeout value for the HTTP response in milliseconds. Default value is `30000`.
- `error_policy` (optional): either `Continue` or `Exit`. Default value is `Exit`.
- [retry_policy](../advanced/retry_policy.md)
- `retry_policy` (optional): controls the policy to retry failed requests (see [retry policy](../advanced/retry_policy.md))