Struct coord::coord::prometheus::Scraper [−][src]
pub struct Scraper {
interval: Option<Duration>,
retain_for: u64,
registry: MetricsRegistry,
metadata: HashMap<Row, u64>,
}
Expand description
Scrapes the prometheus registry when asked and produces a batch of metric
data that can be inserted into the built-in mz_metrics
table.
Fields
interval: Option<Duration>
retain_for: u64
registry: MetricsRegistry
metadata: HashMap<Row, u64>
Implementations
pub fn new(
logging_config: Option<&LoggingConfig>,
registry: MetricsRegistry
) -> Result<Scraper, Error>
pub fn new(
logging_config: Option<&LoggingConfig>,
registry: MetricsRegistry
) -> Result<Scraper, Error>
Constructs a new metrics scraper for the specified registry.
The logging configuration specifies what metrics to scrape and how long to retain them for. If the logging configuration is none, scraping is disabled.
Produces a stream that yields a Message::ScrapeMetrics
at the desired
scrape frequency.
If the scraper is disabled, this stream will yield no items.
pub fn scrape_once(&mut self) -> Vec<TimestampedUpdate>ⓘ
pub fn scrape_once(&mut self) -> Vec<TimestampedUpdate>ⓘ
Scrapes the metrics once, producing a batch of updates that should be
inserted into the mz_metrics
table.
Auto Trait Implementations
impl !RefUnwindSafe for Scraper
impl !UnwindSafe for Scraper
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more