Skip to content

phxql/global-registry-vs-instance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Global MeterRegistry vs. instance MeterRegistry

Reproducer for spring-projects/spring-boot#25610

  1. Start the application
  2. Run curl -s localhost:8080/actuator/prometheus | grep ^bug

You get something like:

bug_instance_total{tag="1",} 1.0
bug_instance_total{tag="2",} 1.0
bug_instance_total{tag="3",} 1.0
bug_instance_total{tag="4",} 1.0
bug_instance_total{tag="5",} 1.0
bug_instance_total{tag="6",} 1.0
bug_instance_total{tag="7",} 1.0
bug_instance_total{tag="8",} 1.0
bug_instance_total{tag="9",} 1.0
bug_instance_total{tag="0",} 1.0
bug_static_total{tag="0",} 10.0

The code which has created these metrics is in Runner. The tags are attached via a MeterFilter, see CustomMeterFilter.

I expected no difference in using Metrics.counter("bug.static").increment() vs. meterRegistry.counter("bug.instance").increment();, but the metrics registered via Metrics have missing tags.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages