Skip to content

Commit

Permalink
Merge pull request prometheus-community#1392 from breed808/filtered_m…
Browse files Browse the repository at this point in the history
…etrics
  • Loading branch information
jkroepke authored Apr 20, 2024
2 parents e97cd78 + 3ba610b commit ff31271
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/collector/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ func (c *Collectors) BuildServeHTTP(disableExporterMetrics bool, timeoutMargin f
}
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) {
Expand Down

0 comments on commit ff31271

Please sign in to comment.