Skip to content

Commit

Permalink
Fixed incompatible install_simple with Tokio runtimes exporters (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
abdolence authored Sep 25, 2023
1 parent 88b8635 commit 42e8601
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ path = "src/lib.rs"

[dependencies]
tracing = "0.1"
opentelemetry = { version = "0.20" }
opentelemetry = { version = "0.20", features = ["rt-tokio"] }
opentelemetry-semantic-conventions = { version = "0.12" }
gcloud-sdk = { version = "0.20", features = ["google-devtools-cloudtrace-v2"] }
tonic = { version = "0.9", features = ["tls"] }
Expand All @@ -32,7 +32,6 @@ rsb_derive = "0.5"
tokio = { version = "1" }
tokio-stream = "0.1"
futures = "0.3"
futures-util = "0.3"
async-trait = "0.1"


Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ impl GcpCloudTraceExporterBuilder {
) -> Result<opentelemetry::sdk::trace::Tracer, opentelemetry::trace::TraceError> {
let exporter = GcpCloudTraceExporter::new(&self.google_project_id).await?;

let mut provider_builder =
opentelemetry::sdk::trace::TracerProvider::builder().with_simple_exporter(exporter);
let mut provider_builder = opentelemetry::sdk::trace::TracerProvider::builder()
.with_batch_exporter(exporter, opentelemetry::runtime::Tokio);
provider_builder = if let Some(config) = self.trace_config {
provider_builder.with_config(config)
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/span_exporter.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::errors::*;
use crate::google_trace_exporter_client::GcpCloudTraceExporterClient;
use crate::TraceExportResult;
use futures_util::future::{BoxFuture, TryFutureExt};
use futures::future::{BoxFuture, TryFutureExt};
use gcloud_sdk::GoogleEnvironment;
use opentelemetry::sdk::export::trace::{ExportResult, SpanData, SpanExporter};
use std::fmt::Formatter;
Expand Down

0 comments on commit 42e8601

Please sign in to comment.