protected static MetricsConsumers getMetricsConsumers() {
        // Must use a whitelisted dimension to avoid it being removed for the MetricsV2Handler
        var defaultConsumerDimension = new ConsumersConfig.Consumer.Metric.Dimension.Builder()
                .key(REASON).value("default-val");

        var customConsumerDimension = new ConsumersConfig.Consumer.Metric.Dimension.Builder()
                .key(REASON).value("custom-val");

        return new MetricsConsumers(new ConsumersConfig.Builder()
                                            .consumer(new ConsumersConfig.Consumer.Builder()
                                                              .name(defaultMetricsConsumerId.id)
                                                              .metric(new ConsumersConfig.Consumer.Metric.Builder()
                                                                              .name(CPU_METRIC)
                                                                              .outputname(CPU_METRIC))
                                                              .metric(new ConsumersConfig.Consumer.Metric.Builder()
                                                                              .name(METRIC_1)
                                                                              .outputname(METRIC_1)
                                                                              .dimension(defaultConsumerDimension)))
                                            .consumer(new ConsumersConfig.Consumer.Builder()
                                                              .name(CUSTOM_CONSUMER)
                                                              .metric(new ConsumersConfig.Consumer.Metric.Builder()
                                                                              .name(METRIC_1)
                                                                              .outputname(METRIC_1)
                                                                              .dimension(customConsumerDimension)))
                                            .build());
    }
Base class for http handler tests.

@author gjoranv
metrics-proxy/src/test/java/ai/vespa/metricsproxy/http/HttpHandlerTestBase.java