vector_api_client/lib.rs
1//! Vector gRPC API client library
2//!
3//! This library provides a Rust client for the Vector gRPC observability API.
4//!
5//! # Example
6//!
7//! ```no_run
8//! use vector_api_client::Client;
9//!
10//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
11//! let mut client = Client::new("http://localhost:9999".parse().unwrap());
12//! client.connect().await?;
13//!
14//! // Check health (standard gRPC health check)
15//! client.health().await?;
16//! println!("Server is healthy");
17//!
18//! // Get components
19//! let components = client.get_components(0).await?;
20//! for component in components.components {
21//! println!("Component: {}", component.component_id);
22//! }
23//! # Ok(())
24//! # }
25//! ```
26
27mod client;
28mod error;
29
30pub use client::Client;
31pub use error::{Error, Result};
32
33/// How long (ms) to wait before attempting to reconnect to the Vector API after a disconnect.
34pub const RECONNECT_DELAY_MS: u64 = 5000;
35
36/// Re-export generated protobuf types
37pub mod proto {
38 pub mod event {
39 tonic::include_proto!("event");
40 }
41
42 tonic::include_proto!("vector.observability.v1");
43}