@Test void writeSpans_updatesPrometheusMetrics() 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);

    post("/api/v2/spans", body);
    post("/api/v2/spans", body);

    Thread.sleep(100); // sometimes CI flakes getting the "http.server.requests" timer
    double messagesCount = registry.counter("zipkin_collector.spans", "transport", "http").count();
    // Get the http count from the registry and it should match the summation previous count
    // and count of calls below
    long httpCount = registry
      .find("http.server.requests")
      .tag("uri", "/api/v2/spans")
      .timer()
      .count();

    // ensure unscoped counter does not exist
    assertThat(scrape())
      .doesNotContain("zipkin_collector_spans_total " + messagesCount)
      .contains("zipkin_collector_spans_total{transport=\"http\",} " + messagesCount)
      .contains(
        "http_server_requests_seconds_count{method=\"POST\",status=\"202\",uri=\"/api/v2/spans\",} "
          + httpCount);
  }
Makes sure the prometheus filter doesn't count twice
zipkin-server/src/test/java/zipkin2/server/internal/prometheus/ITZipkinMetricsDirty.java