pub struct DataSource {
pub authority: String,
pub scheme: String,
pub prefix: Option<String>,
pub query: Query,
pub http_timeout: Option<Duration>,
}
Expand description
Represents a prometheus data source that works over an http(s) host:port endpoint potentially behind a /prometheus_prefix/
Fields§
This should contain the scheme://
scheme: String
Optionally specify if http/https is used. By default ‘http’
prefix: Option<String>
The prefix to reach prometheus on the authority, for example, prometheus may share a
host:port with grafana, etc, and prometheus would be reached by
query: Query
The query to send to prometheus
http_timeout: Option<Duration>
Sets the timeout for the HTTP connection to the prometheus server
Implementations§
Source§impl DataSource
impl DataSource
Sourcepub async fn get(&self) -> Result<Response, DataSourceError>
pub async fn get(&self) -> Result<Response, DataSourceError>
get
is an async operation that returns potentially a Response
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DataSource
impl RefUnwindSafe for DataSource
impl Send for DataSource
impl Sync for DataSource
impl Unpin for DataSource
impl UnwindSafe for DataSource
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