Common tags duplicates meter tags.
See original GitHub issueConfiguring common tags on registry level with combination of meter metrics leads to tags duplication. Steps to reproduce:
- Configure common metrics though meter registry config
- Register metric with additional tags
- Check registered metric id
The issue occurs in MeterFilter.commonTags which concatenates metric tags twice: meter tags + meter tags + common tags
Issue found when I’ve tried to remove such metric from registry. Removal logic applies all MeterFilters again, which leads to tags duplication again and break hashCode contract of Tags.class.
Example: `
SimpleMeterRegistry registry = new SimpleMeterRegistry();
registry.config().commonTags("common-key", "common-value");
Gauge gauge = Gauge.builder("test-gauge", () -> 0L)
.tags("key", "value")
.register(registry);
System.out.print(gauge.getId());
registry.remove(gauge);
Assert.isTrue(registry.getMeters().isEmpty(), () -> "Registry is not empty");
` Output:
MeterId{name=‘test-gauge’, tags=[tag(common-key=common-value),tag(key=value),tag(key=value)]} Exception in thread “main” java.lang.IllegalArgumentException: Registry is not empty
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Duplicate an Instrument Tag in the Instrument Index - Help
On the Duplicate Tag Number - Find Items dialog box, select the instrument tag you want to duplicate, and then click OK. Type...
Read more >The canonical tag prevents duplicate content - Metatags.org
The best solution is to prevent duplicate content from occurring. But in other cases, the canonical tag is the best way to resolve...
Read more >Codes, Tags and Labels—Interpreting Piping and ... - AIChE
EQ - the associated equipment tag (as defined above); SX - duplicate or redundant device suffix (see details below). Duplicate Suffix, SX Rules....
Read more >Duplicates & Multiples Report - ObservePoint Help Center
The Duplicates & Multiples audit report will provide insights into duplicate tag requests and pages where multiple requests for the same tag ......
Read more >Duplicate title tags using ASP.NET MasterPage - Stack Overflow
This eliminates your duplicate tags and puts the title in a clear, visible place at the top in code view. Hope this helps....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I created https://github.com/micrometer-metrics/micrometer/pull/2370 to apply the suggestion from @tommyk-gears above.
@tommyk-gears Thanks for the suggestion. It looks good to me.