From c9f815733bc3f8b3713fa0ce6be65d2b58e678d6 Mon Sep 17 00:00:00 2001 From: David Bernard Date: Mon, 1 Apr 2024 19:11:18 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8D=B1=20(demos)=20start=20example=5F01?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demos/example_01/.gitignore | 1 + demos/example_01/cdevents/.keep | 0 demos/example_01/cdviz-collector.toml | 14 ++++++++++++++ demos/taskfile.yaml | 16 ++++++++++++++++ 4 files changed, 31 insertions(+) create mode 100644 demos/example_01/.gitignore create mode 100644 demos/example_01/cdevents/.keep create mode 100644 demos/example_01/cdviz-collector.toml diff --git a/demos/example_01/.gitignore b/demos/example_01/.gitignore new file mode 100644 index 0000000..8032a18 --- /dev/null +++ b/demos/example_01/.gitignore @@ -0,0 +1 @@ +cdevents/*.json \ No newline at end of file diff --git a/demos/example_01/cdevents/.keep b/demos/example_01/cdevents/.keep new file mode 100644 index 0000000..e69de29 diff --git a/demos/example_01/cdviz-collector.toml b/demos/example_01/cdviz-collector.toml new file mode 100644 index 0000000..e232f99 --- /dev/null +++ b/demos/example_01/cdviz-collector.toml @@ -0,0 +1,14 @@ +[sinks.debug] +type = "debug" + +[sinks.cdviz_db] +type = "db" +url = "postgresql://cdviz:postgres-password@127.0.0.1:5432/cdviz" +pool_connections_min = 1 +pool_connections_max = 10 + +[sources.cdevents_folder] +type = "opendal" +kind = "fs" +polling_interval = "10s" +parameters = { root = "./cdevents" } diff --git a/demos/taskfile.yaml b/demos/taskfile.yaml index 236f2d4..4aba9b1 100644 --- a/demos/taskfile.yaml +++ b/demos/taskfile.yaml @@ -28,3 +28,19 @@ tasks: stack:db-admin:view: cmds: - open http://127.0.0.1:5499 + + cdviz-collector:build: + internal: true + dir: ../cdviz-collector + cmds: + - cargo build + + example_01:run: + dir: example_01 + deps: [ "cdviz-collector:build" ] + env: + RUST_LOG: "cdviz_collector::sinks=debug,info" # cdviz_collector::sources=debug + OTEL_TRACES_SAMPLER: always_off + OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "http://127.0.0.1:4317" + cmds: + - ../../cdviz-collector/target/debug/cdviz-collector --config ./cdviz-collector.toml \ No newline at end of file