mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-31 06:46:36 +00:00
mi: make timeout configurable for build functions (#2377)
This commit is contained in:
@@ -249,7 +249,7 @@ func (c *Collector) Build(logger *slog.Logger, _ *mi.Session) error {
|
||||
|
||||
// Collect sends the metric values for each metric
|
||||
// to the provided prometheus Metric channel.
|
||||
func (c *Collector) Collect(ch chan<- prometheus.Metric) error {
|
||||
func (c *Collector) Collect(ch chan<- prometheus.Metric, _ time.Duration) error {
|
||||
var errs []error
|
||||
|
||||
for _, perfDataObject := range c.objects {
|
||||
|
||||
@@ -42,7 +42,7 @@ func (a collectorAdapter) Describe(_ chan<- *prometheus.Desc) {}
|
||||
|
||||
// Collect implements the prometheus.Collector interface.
|
||||
func (a collectorAdapter) Collect(ch chan<- prometheus.Metric) {
|
||||
if err := a.Collector.Collect(ch); err != nil {
|
||||
if err := a.Collector.Collect(ch, 0); err != nil {
|
||||
panic(fmt.Sprintf("failed to update collector: %v", err))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user