async fn export(&mut self, batch: Vec<SpanData>) -> trace::ExportResult {
        let traces: Vec<Vec<SpanData>> = group_into_traces(batch);
        let trace_count = traces.len();
        let data = self.version.encode(&self.service_name, traces)?;
        let req = Request::builder()
            .method(Method::POST)
            .uri(self.request_url.clone())
            .header(http::header::CONTENT_TYPE, self.version.content_type())
            .header(DATADOG_TRACE_COUNT_HEADER, trace_count)
            .body(data)
            .map_err::<Error, _>(Into::into)?;
        let _ = self.client.send(req).await?.error_for_status()?;
        Ok(())
    }
/// Export spans to datadog-agent
Export spans to datadog-agent
Export spans to datadog - agent
async fn export(&mut self, batch: Vec<SpanData>) -> trace::ExportResult {
        let traces: Vec<Vec<SpanData>> = group_into_traces(batch);
        let trace_count = traces.len();
        let data = self.version.encode(&self.service_name, traces)?;
        let req = Request::builder()
            .method(Method::POST)
            .uri(self.request_url.clone())
            .header(http::header::CONTENT_TYPE, self.version.content_type())
            .header(DATADOG_TRACE_COUNT_HEADER, trace_count)
            .body(data)
            .map_err::<Error, _>(Into::into)?;
        let _ = self.client.send(req).await?.error_for_status()?;
        Ok(())
    }
async fn export ( & mut self , batch : Vec < SpanData > ) -> trace :: ExportResult { let traces : Vec < Vec < SpanData > > = group_into_traces ( batch ) ; let trace_count = traces . len ( ) ; let data = self . version . encode ( & self . service_name , traces ) ? ; let req = Request :: builder ( ) . method ( Method :: POST ) . uri ( self . request_url . clone ( ) ) . header ( http :: header :: CONTENT_TYPE , self . version . content_type ( ) ) . header ( DATADOG_TRACE_COUNT_HEADER , trace_count ) . body ( data ) . map_err :: < Error , _ > ( Into :: into ) ? ; let _ = self . client . send ( req ) . await ? . error_for_status ( ) ? ; Ok ( ( ) ) }
Export spans to datadog-agent
Export spans to datadog - agent
&mut self
batch
Vec<SpanData>
&mut self
batch
Vec<SpanData>