gcp-exporter
gcp-exporter copied to clipboard
Project filtering is (recursively) adding `lifecycleState:ACTIVE`
After running GCP Exporter for a while:
gcp-exporter | 2021/04/24 18:34:18 Projects filter: 'lifecycleState:ACTIVE lifecycleState:ACTIVE ...'
There should only ever be a single occurrence.
Grrr:
type ProjectsCollector struct {
filter string
...
}
// Collect implements Prometheus' Collector interface and is used to collect metrics
func (c *ProjectsCollector) Collect(ch chan<- prometheus.Metric) {
...
// Combine any user-specified filter with "lifecycleState:ACTIVE" to only process active projects
if c.filter != "" {
c.filter += " "
}
c.filter = c.filter + "lifecycleState:ACTIVE"
...
}