Merge pull request #1392 from breed808/filtered_metrics

This commit is contained in:
Jan-Otto Kröpke 2024-04-20 21:35:48 +02:00 committed by GitHub
commit 21a64b1a62
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 1 deletions

View File

@ -32,7 +32,14 @@ func (c *Collectors) BuildServeHTTP(disableExporterMetrics bool, timeoutMargin f
} }
filteredCollectors[name] = col filteredCollectors[name] = col
} }
return nil, NewPrometheus(timeout, c, c.logger)
filtered := Collectors{
logger: c.logger,
collectors: filteredCollectors,
perfCounterQuery: c.perfCounterQuery,
}
return nil, NewPrometheus(timeout, &filtered, c.logger)
} }
return func(w http.ResponseWriter, r *http.Request) { return func(w http.ResponseWriter, r *http.Request) {