public Map<MetricId, Number> metrics() { return metrics; }
@Test
    public void builder_can_retain_subset_of_metrics() {
        MetricsPacket packet = new MetricsPacket.Builder(toServiceId("foo"))
                .putMetrics(List.of(
                        new Metric(toMetricId("remove"), 1),
                        new Metric(toMetricId("keep"), 2)))
                .retainMetrics(Set.of(toMetricId("keep"), toMetricId("non-existent")))
                .build();

        assertFalse("should not contain 'remove'", packet.metrics().containsKey(toMetricId("remove")));
        assertTrue("should contain 'keep'", packet.metrics().containsKey(toMetricId("keep")));
        assertFalse("should not contain 'non-existent'", packet.metrics().containsKey(toMetricId("non-existent")));
    }