diff --git a/pkg/validation/exporter.go b/pkg/validation/exporter.go index 78cd13a1dad84..0a5ffc863d5ad 100644 --- a/pkg/validation/exporter.go +++ b/pkg/validation/exporter.go @@ -56,6 +56,12 @@ func (oe *OverridesExporter) Collect(ch chan<- prometheus.Metric) { return float64(val.Field(i).Uint()), true case float64: return val.Field(i).Float(), true + case bool: + v := 0.0 + if val.Field(i).Bool() { + v = 1.0 + } + return v, true default: return 0, false } diff --git a/pkg/validation/exporter_test.go b/pkg/validation/exporter_test.go index a7a51327599c1..59b4537533e53 100644 --- a/pkg/validation/exporter_test.go +++ b/pkg/validation/exporter_test.go @@ -35,12 +35,13 @@ func TestOverridesExporter_noConfig(t *testing.T) { func TestOverridesExporter_withConfig(t *testing.T) { tenantLimits := map[string]*Limits{ "tenant-a": { - MaxQueriersPerTenant: 5, + MaxQueriersPerTenant: 5, + BloomCompactorEnabled: true, }, } overrides, _ := NewOverrides(Limits{}, newMockTenantLimits(tenantLimits)) exporter := NewOverridesExporter(overrides) count := testutil.CollectAndCount(exporter, "loki_overrides") - assert.Greater(t, count, 0) + assert.Equal(t, 2, count) require.Greater(t, testutil.CollectAndCount(exporter, "loki_overrides_defaults"), 0) }