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.

Remove _total suffix in micrometer using NamingConvention not working in 2.5.0

See original GitHub issue

Describe the bug

I like to remove some suffix in some name metrics, i made it using NamingConvention from micrometer and set it in PrometheusMeterRegistry. This was working just fine in quarkus 1.13.7, but when i change it to quarkus 2.5.0 doesn’t.

Maybe this is a change in micrometer lib or in quarkus?

Thanks

Expected behavior

In quarkus 1.13.7 using micrometer-quickstart example with my namingConvention to remove _total suffix from counter metrics works just fine.

Actual behavior

In quarkus 2.5.0 using micrometer-quickstart example with my namingConvention to remove _total suffix from counter metrics doesn’t remove suffix like quarkus 1.13.7.

How to Reproduce?

Reproducer:

Steps to reproduce the behavior:
1. Clone my [project](https://github.com/quarkusio/quarkus-quickstarts/tree/main/micrometer-quickstart) from micrometer-quickstart
1. Remove the comments to change quarkus version (test with quarkus 1.13.7 and quarkus 2.5.0)
2. Call endpoint http://localhost:8080/example/prime/31 or http://localhost:8080/example/prime/70 
3. Call endpoint http://localhost:8080/q/metrics search for example_prime_number metric 

Output of uname -a or ver

Darwin MacBook-Pro.local 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64

Output of java -version

openjdk version “11.0.2” 2019-01-15

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.5.0

Build tool (ie. output of mvnw --version or gradlew --version)

apache-maven-3.8.1

Additional information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
CarlosPanarellocommented, Nov 29, 2021

@ebullient I make some tests and make a downgrade to version 1.6.5 of the micrometer-core and micrometer-prometheus registry, that is used in quarkus 1 and worked just fine in quarkus 2.

I will open an issue in micrometer about it.

i made the replace in pom like this in my project

<dependencies>
        <dependency>
            <artifactId>quarkus-micrometer</artifactId>
            <groupId>io.quarkus</groupId>
            <exclusions>
                <exclusion>
                    <groupId>io.micrometer</groupId>
                    <artifactId>micrometer-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.micrometer</groupId>
                    <artifactId>micrometer-registry-prometheus</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    <dependency>
        <groupId>io.micrometer</groupId>
        <artifactId>micrometer-core</artifactId>
        <version>1.6.5</version>
    </dependency>
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-registry-prometheus</artifactId>
            <version>1.6.5</version>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-micrometer-registry-prometheus</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>io.micrometer</groupId>
                    <artifactId>micrometer-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.micrometer</groupId>
                    <artifactId>micrometer-registry-prometheus</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
0reactions
ebullientcommented, Nov 30, 2021

Using a filter with the scrape will be fine, as that is running elsewhere (in Prometheus-land, not in your app). This kind of scrape-config adjustment is pretty common.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prometheus config doesn't work with Spring boot 2.3.0
It is 1.5.1 because Spring Boot (Actuator) pulls that dependency in with version 2.3.0. implementation group: 'io.micrometer', name ...
Read more >
Production-ready Features - Spring
Displays a complete list of all the Spring beans in your application. ... cost of them not being available over JMX or when...
Read more >
Drools Documentation - Index of /
Eventually it'll become the default editor, but we will not remove the old one ... Mode turned on or with a manually added...
Read more >
Revised Standard Specifications dated 04-15-22 - Caltrans
to the type of work the firm will perform on the Contract. ... When a portable system is not in use, remove it...
Read more >
Better naming convention - Nikola Poša
Excited and full of enthusiasm, I shared my findings and opinions with ... Reading it, Exception suffix is not nearly as striking as...
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