public void removePipelineMetrics(String pipelineId) {
        registry.removeMatching(MetricFilter.startsWith(name(
                pipelinesPrefix,
                requireNonBlank(pipelineId, "pipelineId is blank")
        )));
    }
@Test
    void removePipelineMetrics() {
        final var metricRegistry = new MetricRegistry();
        final var registry = PipelineMetricRegistry.create(metricRegistry, "PIPELINE", "RULE");

        registry.registerPipelineMeter("pipeline-1", "executed");
        registry.registerStageMeter("pipeline-1", 5, "executed");
        registry.registerLocalRuleMeter("pipeline-1", 5, "rule-1", "executed");
        registry.registerGlobalRuleMeter("rule-1", "executed");

        assertThat(metricRegistry.getMeters().keySet()).containsExactlyInAnyOrder(
                "RULE.rule-1.executed",
                "RULE.rule-1.pipeline-1.5.executed",
                "PIPELINE.pipeline-1.executed",
                "PIPELINE.pipeline-1.stage.5.executed"
        );

        registry.removePipelineMetrics("pipeline-1");

        assertThat(metricRegistry.getMeters().keySet()).containsExactlyInAnyOrder(
                "RULE.rule-1.executed",
                "RULE.rule-1.pipeline-1.5.executed"
        );

        registry.removeRuleMetrics("rule-1");

        assertThat(metricRegistry.getMeters().keySet()).isEmpty();
    }