-
Notifications
You must be signed in to change notification settings - Fork 586
Closed
Milestone
Description
SimpleExporter is not useable with OTLP/gRPC (Tonic client used for gRPC)
Minimal repro:
use tracing::info;
use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::Registry;
use tracing_subscriber::util::SubscriberInitExt;
use opentelemetry_appender_tracing::layer::OpenTelemetryTracingBridge;
use opentelemetry_otlp::WithExportConfig;
fn main() {
let logger_provider = opentelemetry_otlp::new_pipeline()
.logging()
.with_exporter(
opentelemetry_otlp::new_exporter()
.tonic()
.with_endpoint("http://localhost:4317"),
)
.install_simple().unwrap();
// Create a new OpenTelemetryTracingBridge using the above LoggerProvider.
let layer = OpenTelemetryTracingBridge::new(&logger_provider);
tracing_subscriber::registry()
.with(layer)
.init();
info!(name: "my-event", target: "my-target", "hello from {}. My price is {}", "apple", 1.99);
let _ = logger_provider.shutdown();
}Panics with
there is no reactor running, must be called from the context of a Tokio 1.x runtimeIf making the main as tokio::main, then export hangs forever.
Need to modify exporters in such a way that they don't require async runtimes, and can do normal blocking calls (assuming there are APIs to do that).
Metadata
Metadata
Assignees
Labels
No labels