diff --git a/.github/workflows/docker-capture.yml b/.github/workflows/docker-capture.yml index d0efac3..d31e05d 100644 --- a/.github/workflows/docker-capture.yml +++ b/.github/workflows/docker-capture.yml @@ -69,7 +69,7 @@ jobs: platforms: linux/arm64 cache-from: type=gha cache-to: type=gha,mode=max - build-args: BIN=capture-server + build-args: BIN=capture - name: Capture image digest run: echo ${{ steps.docker_build_capture.outputs.digest }} diff --git a/Cargo.lock b/Cargo.lock index c56738f..5caeea4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -370,13 +370,19 @@ dependencies = [ "bytes", "envconfig", "flate2", + "futures", "governor", "health", "metrics", "metrics-exporter-prometheus", + "once_cell", + "opentelemetry", + "opentelemetry-otlp", + "opentelemetry_sdk", "rand", "rdkafka", "redis", + "reqwest 0.12.3", "serde", "serde_json", "serde_urlencoded", @@ -385,30 +391,9 @@ dependencies = [ "tokio", "tower-http", "tracing", - "uuid", -] - -[[package]] -name = "capture-server" -version = "0.1.0" -dependencies = [ - "anyhow", - "assert-json-diff", - "capture", - "envconfig", - "futures", - "once_cell", - "opentelemetry", - "opentelemetry-otlp", - "opentelemetry_sdk", - "rand", - "rdkafka", - "reqwest 0.12.3", - "serde_json", - "tokio", - "tracing", "tracing-opentelemetry", "tracing-subscriber", + "uuid", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index e097eab..180355b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,6 @@ resolver = "2" members = [ "capture", - "capture-server", "common/health", "hook-api", "hook-common", @@ -44,6 +43,10 @@ http = { version = "1.1.0" } http-body-util = "0.1.0" metrics = "0.22.0" metrics-exporter-prometheus = "0.14.0" +once_cell = "1.18.0" +opentelemetry = { version = "0.22.0", features = ["trace"]} +opentelemetry-otlp = "0.15.0" +opentelemetry_sdk = { version = "0.22.1", features = ["trace", "rt-tokio"] } rand = "0.8.5" rdkafka = { version = "0.36.0", features = ["cmake-build", "ssl", "tracing"] } reqwest = { version = "0.12.3", features = ["stream"] } @@ -71,6 +74,7 @@ tokio = { version = "1.34.0", features = ["full"] } tower = "0.4.13" tower-http = { version = "0.5.2", features = ["cors", "limit", "trace"] } tracing = "0.1.40" -tracing-subscriber = "0.3.18" +tracing-opentelemetry = "0.23.0" +tracing-subscriber = { version="0.3.18", features = ["env-filter"] } url = { version = "2.5.0 " } uuid = { version = "1.6.1", features = ["v7", "serde"] } diff --git a/capture-server/Cargo.toml b/capture-server/Cargo.toml deleted file mode 100644 index 39ee742..0000000 --- a/capture-server/Cargo.toml +++ /dev/null @@ -1,28 +0,0 @@ -[package] -name = "capture-server" -version = "0.1.0" -edition = "2021" - -[lints] -workspace = true - -[dependencies] -capture = { path = "../capture" } -envconfig = { workspace = true } -opentelemetry = { version = "0.22.0", features = ["trace"]} -opentelemetry-otlp = "0.15.0" -opentelemetry_sdk = { version = "0.22.1", features = ["trace", "rt-tokio"] } -tokio = { workspace = true } -tracing = { workspace = true } -tracing-opentelemetry = "0.23.0" -tracing-subscriber = { workspace = true, features = ["env-filter"] } - -[dev-dependencies] -anyhow = { workspace = true, features = [] } -assert-json-diff = { workspace = true } -futures = "0.3.29" -once_cell = "1.18.0" -rand = { workspace = true } -rdkafka = { workspace = true } -reqwest = { workspace = true } -serde_json = { workspace = true } diff --git a/capture/Cargo.toml b/capture/Cargo.toml index ae5ad9a..97d310f 100644 --- a/capture/Cargo.toml +++ b/capture/Cargo.toml @@ -19,6 +19,9 @@ governor = { workspace = true } health = { path = "../common/health" } metrics = { workspace = true } metrics-exporter-prometheus = { workspace = true } +opentelemetry = { workspace = true } +opentelemetry-otlp = { workspace = true } +opentelemetry_sdk = { workspace = true } rand = { workspace = true } rdkafka = { workspace = true } redis = { version = "0.23.3", features = [ @@ -34,8 +37,17 @@ time = { workspace = true } tokio = { workspace = true } tower-http = { workspace = true } tracing = { workspace = true } +tracing-opentelemetry = { workspace = true } +tracing-subscriber = { workspace = true } uuid = { workspace = true } [dev-dependencies] assert-json-diff = { workspace = true } axum-test-helper = { git = "https://github.com/posthog/axum-test-helper.git" } # TODO: remove, directly use reqwest like capture-server tests +anyhow = { workspace = true } +futures = { workspace = true } +once_cell = { workspace = true } +rand = { workspace = true } +rdkafka = { workspace = true } +reqwest = { workspace = true } +serde_json = { workspace = true } diff --git a/capture-server/src/main.rs b/capture/src/main.rs similarity index 100% rename from capture-server/src/main.rs rename to capture/src/main.rs diff --git a/capture-server/tests/common.rs b/capture/tests/common.rs similarity index 100% rename from capture-server/tests/common.rs rename to capture/tests/common.rs diff --git a/capture-server/tests/events.rs b/capture/tests/events.rs similarity index 100% rename from capture-server/tests/events.rs rename to capture/tests/events.rs