snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

Micrometer custom MeterFilter not registered when not declared with @Produces annotation #437

Closed snowdrop-bot closed 3 years ago

snowdrop-bot commented 3 years ago

Describe the bug

Hello,

While tryin to add a custom MeterFilter, I was able to do it following the guide, usin a CDI bean that produces MeterFiler beans.

@Singleton
public class CustomConfiguration {

    @Produces
    @Singleton
    public MeterFilter customMeterFilter() {
        return ...;
    }
}

However, annotating my class with Singleton to make it a bean did not work.

@Singleton
public class CustomMeterFilter implements MeterFilter {

}

I was expecting that no matter the way the bean is declared, it would work, maybe I miss something ?

Expected behavior

Any MeterFilter bean would be added to the injectable MeterRegistry produced by quarkus extension

Actual behavior

Only bean created with @Produces annotation are added to the list of MeterFilter

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

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

No response

Additional information

No response


https://github.com/quarkusio/quarkus/issues/20703


$upstream:20703$