question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Common tags duplicates meter tags.

See original GitHub issue

Configuring common tags on registry level with combination of meter metrics leads to tags duplication. Steps to reproduce:

  1. Configure common metrics though meter registry config
  2. Register metric with additional tags
  3. 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:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
izeyecommented, Dec 5, 2020

I created https://github.com/micrometer-metrics/micrometer/pull/2370 to apply the suggestion from @tommyk-gears above.

0reactions
izeyecommented, Nov 26, 2020

@tommyk-gears Thanks for the suggestion. It looks good to me.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found