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