pub struct Reporter { /* private fields */ }
Implementations§
Source§impl Reporter
impl Reporter
Sourcepub async fn start(address: impl Into<String>) -> Self
pub async fn start(address: impl Into<String>) -> Self
Open gRPC client stream to send collected trace context. This function generates a new async task which watch to arrive new trace context. We can send collected context to push into sender.
§Example
use std::error::Error;
use tokio;
use skywalking_rust::context::trace_context::TracingContext;
use skywalking_rust::reporter::grpc::Reporter;
#[tokio::main]
async fn main () -> Result<(), Box<dyn Error>> {
let reporter = Reporter::start("localhost:12800").await;
let mut context = TracingContext::default("service", "instance");
reporter.sender().send(context).await?;
reporter.shutdown().await?;
Ok(())
}
pub async fn shutdown(self) -> Result<(), Box<dyn Error>>
pub fn sender(&self) -> Sender<TracingContext>
Auto Trait Implementations§
impl Freeze for Reporter
impl RefUnwindSafe for Reporter
impl Send for Reporter
impl Sync for Reporter
impl Unpin for Reporter
impl UnwindSafe for Reporter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request