Skip to content

Runnable examples

The Oura repository ships a collection of ready-to-run example projects under the examples/ directory. Each one is a complete daemon.toml wiring a source, an optional filter chain, and a sink — plus any companion files — so you can clone the repo and run a full pipeline end-to-end.

Want a short config snippet to drop into your own daemon.toml rather than a whole project? See Recipes.

Running an example

Most examples reference companion files and relative paths, so run them from inside their own directory rather than from the repository root:

Terminal window
cd examples/<name>
oura daemon --config daemon.toml

Running from the repository root would scatter relative output and state (./output, ./snapshot, cursor and database files) in the wrong place and break the path-based examples.

Most examples run on the default binary as-is. Only a few target an integration that isn’t bundled — the kafka and zeromq sinks, the mithril source, and the WasmPlugin filter — and those need a build with the matching cargo feature. See Install from source for the feature flags, or use a Docker image that bundles them.

Companion files & setup

Some examples need more than the daemon.toml — a backing service (docker compose up -d), a build step, a cargo feature flag, or they write files to the working directory. Each example’s own README.md documents its pipeline, prerequisites, and run command. Check it before running.

Sources

ExampleWhat it shows
n2c_sourceNode-to-Client source over a unix socket → Stdout
hydraHydra head source over a WebSocket → Stdout
mithrilMithril snapshot bootstrap with a Breadcrumbs intersect
dolos_sourceUTxO RPC (U5C) source against a Dolos/Demeter endpoint

Filters & pipelines

ExampleWhat it shows
selectSplitBlockParseCborSelect by address → Stdout
metadata_regex_filterSelect matching a metadata label + regex (preprod) → Stdout
parse_cborSplitBlockParseCbor → JSONL file output
into_jsonParseCborIntoJson → compressed JSONL file output
wasm_basicCustom WasmPlugin filter loaded from a .wasm file

Sinks

ExampleWhat it shows
stdoutLegacy v1 events printed to standard output
webhook_basicsWebHook sink posting events over HTTP
kafkaKafka sink with ByBlock partitioning
rabbitmqRabbitmq sink
zeromqZeromq PUSH socket sink
elasticsearchElasticSearch sink
redisRedis streams sink
sqliteSqlDb sink writing raw CBOR into SQLite
postgresqlSqlDb sink targeting PostgreSQL
file_rotateFileRotate sink writing rotated, compressed JSONL
aws_lambdaAwsLambda sink invoking a function per event
aws_s3AwsS3 sink writing objects
aws_sqsAwsSqs sink enqueueing messages
gcp_pubsubGcpPubSub sink publishing to a topic
gcp_cloudfunctionGcpCloudFunction sink calling a function
assertAssert sink used for testing/validation

Cursors

ExampleWhat it shows
file_cursorPersisting pipeline progress to a File cursor
redis_cursorPersisting pipeline progress to a Redis cursor

Observability

ExampleWhat it shows
metricsExposing a Prometheus metrics endpoint via the [metrics] block

As a library

The examples/lib project shows how to embed Oura in a Rust application with custom stages — a custom filter plus a custom sink that persists events into SQLite. See its README for the sqlx-cli setup, and the Library usage page for the API overview.