@Test void writeSpans_updatesMetrics() throws Exception {
    List<Span> spans = List.of(LOTS_OF_SPANS[0], LOTS_OF_SPANS[1], LOTS_OF_SPANS[2]);
    byte[] body = SpanBytesEncoder.JSON_V2.encodeList(spans);
    double messagesCount =
      registry.counter("zipkin_collector.messages", "transport", "http").count();
    double bytesCount = registry.counter("zipkin_collector.bytes", "transport", "http").count();
    double spansCount = registry.counter("zipkin_collector.spans", "transport", "http").count();
    post("/api/v2/spans", body);
    post("/api/v2/spans", body);

    String json = getAsString("/metrics");

    assertThat(readDouble(json, "$.['counter.zipkin_collector.messages.http']"))
      .isEqualTo(messagesCount + 2.0);
    assertThat(readDouble(json, "$.['counter.zipkin_collector.bytes.http']"))
      .isEqualTo(bytesCount + (body.length * 2));
    assertThat(readDouble(json, "$.['gauge.zipkin_collector.message_bytes.http']"))
      .isEqualTo(body.length);
    assertThat(readDouble(json, "$.['counter.zipkin_collector.spans.http']"))
      .isEqualTo(spansCount + (spans.size() * 2));
    assertThat(readDouble(json, "$.['gauge.zipkin_collector.message_spans.http']"))
      .isEqualTo(spans.size());
  }
Tests here look at values based on counter values, so need to run independently. It would seem
correct to {@link PrometheusMeterRegistry#clear() clear the registry} to isolate counters
incremented in one test from interfering with another. However, this clears the metrics
themselves, resulting in an empty {@link PrometheusMeterRegistry#scrape()}.

<p>Currently, the only way we know how to reset the whole registry is to recreate the Spring
context, via {@link DirtiesContext} on each test. This is extremely slow, so please only add
tests that require isolation here!
zipkin-server/src/test/java/zipkin2/server/internal/prometheus/ITZipkinMetricsDirty.java