Skip to content

[Question] Broken pipe #183

Description

@Gau-thier

Hi,

First of all, thanks for this lib and the great documentation.
I have followed your example while trying to use opentelemetry on my product, but I am facing a Broken pipe error that I cannot understand...

I initialize the tracer via the following code:

use std::time::Duration;

use opentelemetry::{global, KeyValue};
use opentelemetry_otlp::{ExportConfig, WithExportConfig};
use opentelemetry_sdk::{
    propagation::TraceContextPropagator, runtime::TokioCurrentThread, trace::TracerProvider,
    Resource,
};

pub fn init_traces() {
    global::set_text_map_propagator(TraceContextPropagator::new());

    let service_name_resource = Resource::new(vec![KeyValue::new("service.name", "vault")]);

    let tracer = TracerProvider::builder()
        .with_batch_exporter(
            opentelemetry_otlp::SpanExporter::builder()
                .with_tonic().with_export_config(ExportConfig { endpoint: Some("https://url".to_string()), protocol: opentelemetry_otlp::Protocol::HttpJson, timeout: Duration::new(1, 0) })
                .build()
                .unwrap(),
            TokioCurrentThread,
        )
        .with_resource(service_name_resource)
        .build();

    global::set_tracer_provider(tracer);
}

and then wrap it like explained in the doc:

HttpServer::new(move || {
        App::new()
            .app_data(web::Data::new(pool_state.clone()))
            .service(
                web::scope("/health")
                    .service(handle_alive)
                    .service(handle_ready),
            )
            .wrap(RequestTracing::new())
            .service(
                web::scope("/business")
                    .service(handle_business)
    })
    .bind(("0.0.0.0", http_api_port))?
    .run()
    .await?;

then I am facing the following error in my logs:

name=\"BatchSpanProcessor.Flush.ExportError\" reason=\"ExportFailed(Status { code: Unknown, message: \\\", detailed error message: transport error tonic::transport::Error(Transport, hyper::Error(Io, Custom { kind: BrokenPipe, error: \\\\\\\"stream closed because of a broken pipe\\\\\\\" }))\\\" })\" message=Failed during the export process

but before that I have interesting logs like:

resolve; host=endpoint_uri

connecting to uri:443

connected to uri:443

binding client connection

client connection bound

send frame=Settings { flags: (0x0), enable_push: 0, initial_window_size: 2097152, max_frame_size: 16384, max_header_list_size: 16384 }

Connection; peer=Client

service.ready=true message=processing request

send frame=WindowUpdate { stream_id: StreamId(0), size_increment: 5177345 }

send frame=Headers { stream_id: StreamId(1), flags: (0x4: END_HEADERS) }

send frame=Data { stream_id: StreamId(1) }

send frame=Data { stream_id: StreamId(1), flags: (0x1: END_STREAM) }

and then

connection task error: hyper::Error(Io, Custom { kind: BrokenPipe, error: \"connection closed because of a broken pipe\" })

inside my `cargo.toml``

actix-web-opentelemetry = "0.20.1"
opentelemetry = "0.27.0" 
opentelemetry-appender-tracing = "0.27.0" 
opentelemetry-otlp = "0.27.0"
opentelemetry-stdout = "0.27.0"
opentelemetry_sdk = { version = "0.27.1", features = ["rt-tokio-current-thread"] }

I do think I am missing something in my configuration or whatever, but I cannot find what it is...

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions