Skip to content

Commit

Permalink
Add a test verifying that a single character meter name is allowed fo…
Browse files Browse the repository at this point in the history
…r Prometheus (#5791)
  • Loading branch information
izeye authored Jan 10, 2025
1 parent 7e35196 commit 521d57d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,12 @@ void doesNotCallConventionOnScrape() {
assertThat(convention.tagKeyCount.get()).isEqualTo(expectedTagKeyCount);
}

@Test
void scrapeWhenMeterNameContainsSingleCharacter() {
registry.counter("c").increment();
assertThatNoException().isThrownBy(() -> registry.scrape());
}

private static class CountingPrometheusNamingConvention extends PrometheusNamingConvention {

AtomicInteger nameCount = new AtomicInteger();
Expand Down

0 comments on commit 521d57d

Please sign in to comment.