I defined some metrics within <metrics:register> element in spring xml configuration. And I need these metrics to be injected into fields annotated with @Metric. But in fact, metrics-spring will create and register metrics using @Metric annotation before registering metrics defined within <metrics:register>. As a result, IllegalArgumentException("A metric named xxx already exists") was thrown when registering metrics defined within<metrics:register>.
Is there any way to give<metrics:register> higher precedence?
Interesting problem. Can you share what metrics you're registering with <metrics:register>, and what metrics you're injecting into fields with @Metric?
I defined some metrics within <metrics:register> element in spring xml configuration. And I need these metrics to be injected into fields annotated with @Metric. But in fact, metrics-spring will create and register metrics using @Metric annotation before registering metrics defined within <metrics:register>. As a result, IllegalArgumentException("A metric named xxx already exists") was thrown when registering metrics defined within<metrics:register>.
Is there any way to give<metrics:register> higher precedence?