pub struct Client { /* private fields */ }Expand description
gRPC client for the Vector observability API
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(uri: Uri) -> Self
pub fn new(uri: Uri) -> Self
Create a new gRPC client
The client is not connected until connect() is called.
§Arguments
uri- The gRPC server URI (e.g.,"http://localhost:9999".parse().unwrap())
Sourcepub async fn health(&mut self) -> Result<()>
pub async fn health(&mut self) -> Result<()>
Check if the API server is healthy using the standard gRPC health check protocol (grpc.health.v1.Health/Check).
Queries the empty service name (""), which represents whole-server
health. This is the default used by Kubernetes gRPC probes and
grpc-health-probe.
Returns Ok(()) if the server is SERVING, or an error otherwise.
Sourcepub async fn get_meta(&mut self) -> Result<GetMetaResponse>
pub async fn get_meta(&mut self) -> Result<GetMetaResponse>
Get metadata about the Vector instance
Sourcepub async fn get_components(
&mut self,
limit: i32,
) -> Result<GetComponentsResponse>
pub async fn get_components( &mut self, limit: i32, ) -> Result<GetComponentsResponse>
Get information about configured components
§Arguments
limit- Maximum number of components to return (0 = no limit)
Sourcepub async fn get_allocation_tracing_status(
&mut self,
) -> Result<GetAllocationTracingStatusResponse>
pub async fn get_allocation_tracing_status( &mut self, ) -> Result<GetAllocationTracingStatusResponse>
Check whether allocation tracing is active on the connected Vector instance
Sourcepub async fn stream_heartbeat(
&mut self,
interval_ms: i32,
) -> Result<impl Stream<Item = Result<StreamHeartbeatResponse>>>
pub async fn stream_heartbeat( &mut self, interval_ms: i32, ) -> Result<impl Stream<Item = Result<StreamHeartbeatResponse>>>
Sourcepub async fn stream_uptime(
&mut self,
interval_ms: i32,
) -> Result<impl Stream<Item = Result<StreamUptimeResponse>>>
pub async fn stream_uptime( &mut self, interval_ms: i32, ) -> Result<impl Stream<Item = Result<StreamUptimeResponse>>>
Sourcepub async fn stream_component_allocated_bytes(
&mut self,
interval_ms: i32,
) -> Result<impl Stream<Item = Result<StreamComponentAllocatedBytesResponse>>>
pub async fn stream_component_allocated_bytes( &mut self, interval_ms: i32, ) -> Result<impl Stream<Item = Result<StreamComponentAllocatedBytesResponse>>>
Sourcepub async fn stream_component_metrics(
&mut self,
metric: MetricName,
interval_ms: i32,
) -> Result<impl Stream<Item = Result<StreamComponentMetricsResponse>>>
pub async fn stream_component_metrics( &mut self, metric: MetricName, interval_ms: i32, ) -> Result<impl Stream<Item = Result<StreamComponentMetricsResponse>>>
Stream per-component metrics for a chosen metric name.
§Arguments
metric- Which metric to streaminterval_ms- Update interval in milliseconds
Sourcepub async fn stream_output_events(
&mut self,
request: StreamOutputEventsRequest,
) -> Result<impl Stream<Item = Result<StreamOutputEventsResponse>> + use<>>
pub async fn stream_output_events( &mut self, request: StreamOutputEventsRequest, ) -> Result<impl Stream<Item = Result<StreamOutputEventsResponse>> + use<>>
Stream events from components matching patterns
This is used by vector tap to capture events.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl !UnwindSafe for Client
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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