Skip to content

Commit

Permalink
Use patched versions of OpenTelemetry crates
Browse files Browse the repository at this point in the history
  • Loading branch information
aumetra committed May 11, 2024
1 parent 428d837 commit 984af4e
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 390 deletions.
316 changes: 92 additions & 224 deletions Cargo.lock

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ members = [
"lib/blowocking",
"lib/cursiv",
"lib/geomjeungja",
"lib/http-compat",
"lib/http-signatures",
"lib/just-retry",
"lib/masto-id-convert",
Expand Down Expand Up @@ -126,3 +125,11 @@ install-updater = true
diesel-async = { git = "https://github.com/weiznich/diesel_async.git", rev = "d02798c67065d763154d7272dd0c09b39757d0f2" }
scraper = { git = "https://github.com/causal-agent/scraper.git", rev = "d67111f5cc0b7da6e6ff10e4549d87cf09ba3e5b" }
tokio-postgres-rustls = { git = "https://github.com/jbg/tokio-postgres-rustls.git", rev = "b16c1bc0f5d4f91324174fd1bd839d743a70f86a" }

# Patch to make OpenTelemetry with with hyper 1
opentelemetry = { git = "https://github.com/open-telemetry/opentelemetry-rust.git", rev = "b44cb130e4a102b0d676289e91c003f4b1008d08" }
opentelemetry-http = { git = "https://github.com/open-telemetry/opentelemetry-rust.git", rev = "b44cb130e4a102b0d676289e91c003f4b1008d08" }
opentelemetry-otlp = { git = "https://github.com/open-telemetry/opentelemetry-rust.git", rev = "b44cb130e4a102b0d676289e91c003f4b1008d08" }
opentelemetry_sdk = { git = "https://github.com/open-telemetry/opentelemetry-rust.git", rev = "b44cb130e4a102b0d676289e91c003f4b1008d08" }
tonic = { git = "https://github.com/hyperium/tonic.git", rev = "9b306af386528f11dbd022bc372d367adc4e96b5" }
tracing-opentelemetry = { git = "https://github.com/aumetra/tracing-opentelemetry.git", branch = "v0.1.x-http1" }
2 changes: 1 addition & 1 deletion crates/kitsune-observability/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ license.workspace = true
async-trait = "0.1.80"
eyre = "0.6.12"
http-body-util = "0.1.1"
http-compat = { path = "../../lib/http-compat" }
hyper = { version = "1.3.1", default-features = false }
kitsune-config = { path = "../kitsune-config" }
kitsune-http-client = { path = "../kitsune-http-client" }
Expand All @@ -19,6 +18,7 @@ opentelemetry = { version = "0.22.0", default-features = false, features = [
opentelemetry-http = "0.11.1"
opentelemetry-otlp = { version = "0.15.0", default-features = false, features = [
"grpc-tonic",
"http-json",
"http-proto",
"tls",
"tls-roots",
Expand Down
5 changes: 2 additions & 3 deletions crates/kitsune-observability/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use async_trait::async_trait;
use eyre::WrapErr;
use http_body_util::BodyExt;
use http_compat::Compat;
use kitsune_config::{open_telemetry::Transport, Configuration};
use opentelemetry::trace::{noop::NoopTracer, Tracer};
use opentelemetry_http::{Bytes, HttpClient, HttpError, Request, Response};
Expand Down Expand Up @@ -34,12 +33,12 @@ impl HttpClient for HttpClientAdapter {
let (parts, body) = request.into_parts();
let request = Request::from_parts(parts, body.into());

let response = self.inner.execute(request.compat()).await?.into_inner();
let response = self.inner.execute(request).await?.into_inner();

Check warning on line 36 in crates/kitsune-observability/src/lib.rs

View check run for this annotation

Codecov / codecov/patch

crates/kitsune-observability/src/lib.rs#L36

Added line #L36 was not covered by tests

let (parts, body) = response.into_parts();
let body = body.collect().await?.to_bytes();

Ok(hyper::http::Response::from_parts(parts, body).compat())
Ok(hyper::http::Response::from_parts(parts, body))

Check warning on line 41 in crates/kitsune-observability/src/lib.rs

View check run for this annotation

Codecov / codecov/patch

crates/kitsune-observability/src/lib.rs#L41

Added line #L41 was not covered by tests
}
}

Expand Down
13 changes: 0 additions & 13 deletions lib/http-compat/Cargo.toml

This file was deleted.

1 change: 0 additions & 1 deletion lib/http-compat/LICENSE-APACHE-2.0

This file was deleted.

1 change: 0 additions & 1 deletion lib/http-compat/LICENSE-MIT

This file was deleted.

8 changes: 0 additions & 8 deletions lib/http-compat/src/lib.rs

This file was deleted.

74 changes: 0 additions & 74 deletions lib/http-compat/src/v0_2.rs

This file was deleted.

64 changes: 0 additions & 64 deletions lib/http-compat/src/v1.rs

This file was deleted.

0 comments on commit 984af4e

Please sign in to comment.