pub struct LokiClient { /* private fields */ }Expand description
Client for querying Loki via its HTTP API.
Executes LogQL queries against the /loki/api/v1/query_range endpoint.
Uses reqwest for HTTP requests on both native (with tokio) and WASM
(with wasm-bindgen-futures).
§Example
ⓘ
use enya_client::logs::{LokiClient, LogsClient, LogsQuery};
let client = LokiClient::new("http://localhost:3100");
let query = LogsQuery::new(start_ns, end_ns)
.with_label("app", "myservice");
let promise = client.query_logs(query, &ctx);Implementations§
Trait Implementations§
Source§impl LogsClient for LokiClient
impl LogsClient for LokiClient
Source§fn query_logs(&self, query: LogsQuery, ctx: &Context) -> Promise<LogsResult>
fn query_logs(&self, query: LogsQuery, ctx: &Context) -> Promise<LogsResult>
Execute a logs query (non-blocking). Read more
Source§fn fetch_streams(&self, ctx: &Context) -> Promise<StreamsResult>
fn fetch_streams(&self, ctx: &Context) -> Promise<StreamsResult>
Fetch all available log streams/labels from the backend. Read more
Source§fn backend_type(&self) -> &'static str
fn backend_type(&self) -> &'static str
Get the backend type identifier (e.g., “loki”, “elasticsearch”).
Source§fn health_check(&self, ctx: &Context) -> Promise<HealthCheckResult>
fn health_check(&self, ctx: &Context) -> Promise<HealthCheckResult>
Check backend health and connectivity. Read more
Auto Trait Implementations§
impl Freeze for LokiClient
impl !RefUnwindSafe for LokiClient
impl Send for LokiClient
impl Sync for LokiClient
impl Unpin for LokiClient
impl UnsafeUnpin for LokiClient
impl !UnwindSafe for LokiClient
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