Skip to content

Commit

Permalink
remove opentelemetry for now
Browse files Browse the repository at this point in the history
  • Loading branch information
aumetra committed May 11, 2024
1 parent 428d837 commit dc276c7
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 514 deletions.
385 changes: 63 additions & 322 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 0 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
16 changes: 0 additions & 16 deletions crates/kitsune-observability/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,11 @@ version.workspace = true
license.workspace = true

[dependencies]
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" }
opentelemetry = { version = "0.22.0", default-features = false, features = [
"trace",
] }
opentelemetry-http = "0.11.1"
opentelemetry-otlp = { version = "0.15.0", default-features = false, features = [
"grpc-tonic",
"http-proto",
"tls",
"tls-roots",
"trace",
] }
opentelemetry_sdk = { version = "0.22.1", default-features = false, features = [
"rt-tokio",
] }
tracing = "0.1.40"
tracing-error = "0.2.0"
tracing-opentelemetry = { version = "0.23.0", default-features = false }
Expand Down
23 changes: 9 additions & 14 deletions crates/kitsune-observability/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
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 eyre::{bail, WrapErr};
use kitsune_config::Configuration;
use opentelemetry::trace::{noop::NoopTracer, Tracer};
use opentelemetry_http::{Bytes, HttpClient, HttpError, Request, Response};
use opentelemetry_otlp::{SpanExporterBuilder, WithExportConfig};
use opentelemetry_sdk::runtime::Tokio;
use std::{env, fmt};
use std::env;
use tracing_error::ErrorLayer;
use tracing_opentelemetry::{OpenTelemetryLayer, PreSampledTracer};
use tracing_subscriber::{
Expand All @@ -16,7 +10,7 @@ use tracing_subscriber::{
Layer as _, Registry,
};

#[derive(Clone)]
/*#[derive(Clone)]
struct HttpClientAdapter {
inner: kitsune_http_client::Client,
}
Expand Down Expand Up @@ -59,7 +53,7 @@ macro_rules! build_exporter {
exporter
}};
}
}*/

fn initialise_logging<T>(tracer: T) -> eyre::Result<()>
where
Expand All @@ -82,8 +76,8 @@ where
}

pub fn initialise(config: &Configuration) -> eyre::Result<()> {
if let Some(ref opentelemetry_config) = config.opentelemetry {
let http_client = HttpClientAdapter {
if config.opentelemetry.is_some() {

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

View check run for this annotation

Codecov / codecov/patch

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

Added line #L79 was not covered by tests
/*let http_client = HttpClientAdapter {
inner: kitsune_http_client::Client::default(),
};
Expand All @@ -99,7 +93,8 @@ pub fn initialise(config: &Configuration) -> eyre::Result<()> {
.with_exporter(trace_exporter)
.install_batch(Tokio)?;
initialise_logging(tracer)?;
initialise_logging(tracer)?;*/
bail!("OpenTelemetry is not supported at the moment");

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

View check run for this annotation

Codecov / codecov/patch

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

Added line #L97 was not covered by tests
} else {
initialise_logging(NoopTracer::new())?;
}
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 dc276c7

Please sign in to comment.