-
I'm actually writing an extension to collect custom logs from endpoints and send them elsewhere with I just have a simple build time config:
I've started to write this in my processor:
I suppose, according to the quarkus documentation, that i'm in the case: How am i suppose to configure metrics only for my extension ? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
/cc @ebullient (metrics), @jmartisk (metrics) |
Beta Was this translation helpful? Give feedback.
-
@Sgitario is there a way to enable/disable metrics for the REST Clients (legacy or reactive)? I couldn't find an associated configuration property. Not sure if it would be a runtime property though and if it would be possible to use |
Beta Was this translation helpful? Give feedback.
-
For the original poster: enabling/disabling client metrics is a little more complicated for http specifically. Metrics are already collected for REST Client (with micrometer) for Resteasy and Resteasy Reactive... if you're working against the micrometer extension, you might be better off following a pattern like this: Your extension can then focus on enabling or disabling the construction of a custom MeterRegistry bean. As far as testing for enabled metrics at build time, you'd want to look at a combination of config, you would want to do something akin to this: Here is an example processor that splits to do different things if micrometer is present: |
Beta Was this translation helpful? Give feedback.
For the original poster: enabling/disabling client metrics is a little more complicated for http specifically. Metrics are already collected for REST Client (with micrometer) for Resteasy and Resteasy Reactive... if you're working against the micrometer extension, you might be better off following a pattern like this:
https://github.com/micrometer-metrics/micrometer/blob/main/micrometer-core/src/main/java/io/micrometer/core/instrument/logging/LoggingMeterRegistry.java
Your extension can then focus on enabling or disabling the construction of a custom MeterRegistry bean.
As far as testing for enabled metrics at build time, you'd want to look at a combination of config, you would want to do…