You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Mikael Andersson Wigander <mi...@gmail.com> on 2020/04/08 06:43:33 UTC

Unable to get Micrometer counter in Camel 3.2.0

Hi

Previously I used to run my Camel routes under 2.25.0 and with Micrometer component for JMX in Spring Boot 2.1.9.

This route gives me a “messasges” counter in JMX to study:

.to("micrometer:counter:messages")





But now that I upgraded to Camel 3.2.0 and Spring 2.2.6 it is not available in JMX anymore.

Instead I get three other categories:

* gauges
* meters
* timers



Same dependencies apply and also my bean is the same

@Bean(name = MicrometerConstants.METRICS_REGISTRY_NAME)
public MeterRegistry getMeterRegistry() {
    CompositeMeterRegistry meterRegistry = new CompositeMeterRegistry();
    meterRegistry.add(new JmxMeterRegistry(
        CamelJmxConfig.DEFAULT,
        Clock.SYSTEM,
        HierarchicalNameMapper.DEFAULT));

    return meterRegistry;
}


Please advice

Thx

M

Re: Unable to get Micrometer counter in Camel 3.2.0

Posted by Mikael Andersson Wigander <mi...@gmail.com>.
Done.

tried to explain afaik

Thx for the reminder

M

> On 8 Apr 2020, at 17:57, Andrea Cosentino <an...@gmail.com> wrote:
> 
> Open an issue please. Reporting this stuff on the mailing list will be lost.
> 
> Il mer 8 apr 2020, 17:49 Mikael Andersson Wigander <
> mikael.grevsten@gmail.com> ha scritto:
> 
>> Temporarily solved by not using Camel implementation and instead use
>> micrometer.io <http://micrometer.io/>, declare the bean, autowire in the
>> route and use a process to count.
>> 
>> I have tried to debug and see where it breaks but failed. Haven’t the
>> deepest knowledge on the different registries that are in place here but I
>> think the Camel implementation never gets registered accordingly.
>> 
>> Thx
>> 
>> M
>> 
>> 
>>> On 8 Apr 2020, at 10:04, Mikael Andersson Wigander <
>> mikael.grevsten@gmail.com> wrote:
>>> 
>>> Thanks, I did and I can’t see anything new or significant
>>> 
>>> Tried Timers but they doesn’t work either
>>> 
>>> M
>>> 
>>>> On 8 Apr 2020, at 09:17, Claus Ibsen <cl...@gmail.com> wrote:
>>>> 
>>>> Hi
>>>> 
>>>> Its a big upgrade, also micrometer is upgraded. So it may have changed
>>>> what information it exports to JMX.
>>>> Check on their project.
>>>> 
>>>> 
>>>> 
>>>> On Wed, Apr 8, 2020 at 8:46 AM Mikael Andersson Wigander
>>>> <mi...@gmail.com> wrote:
>>>>> 
>>>>> Yes, it is added
>>>>> 
>>>>> M
>>>>> 
>>>>>> On 8 Apr 2020, at 08:45, Andrea Cosentino <an...@gmail.com> wrote:
>>>>>> 
>>>>>> Did you add the camel-management dependency? Otherwise Jmx won't be
>> enabled
>>>>>> 
>>>>>> Il giorno mer 8 apr 2020 alle ore 08:43 Mikael Andersson Wigander <
>> mikael.grevsten@gmail.com <ma...@gmail.com>> ha scritto:
>>>>>> Hi
>>>>>> 
>>>>>> Previously I used to run my Camel routes under 2.25.0 and with
>> Micrometer component for JMX in Spring Boot 2.1.9.
>>>>>> 
>>>>>> This route gives me a “messasges” counter in JMX to study:
>>>>>> 
>>>>>> .to("micrometer:counter:messages")
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> But now that I upgraded to Camel 3.2.0 and Spring 2.2.6 it is not
>> available in JMX anymore.
>>>>>> 
>>>>>> Instead I get three other categories:
>>>>>> 
>>>>>> * gauges
>>>>>> * meters
>>>>>> * timers
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> Same dependencies apply and also my bean is the same
>>>>>> 
>>>>>> @Bean(name = MicrometerConstants.METRICS_REGISTRY_NAME)
>>>>>> public MeterRegistry getMeterRegistry() {
>>>>>>  CompositeMeterRegistry meterRegistry = new CompositeMeterRegistry();
>>>>>>  meterRegistry.add(new JmxMeterRegistry(
>>>>>>      CamelJmxConfig.DEFAULT,
>>>>>>      Clock.SYSTEM,
>>>>>>      HierarchicalNameMapper.DEFAULT));
>>>>>> 
>>>>>>  return meterRegistry;
>>>>>> }
>>>>>> 
>>>>>> 
>>>>>> Please advice
>>>>>> 
>>>>>> Thx
>>>>>> 
>>>>>> M
>>>>> 
>>>> 
>>>> 
>>>> --
>>>> Claus Ibsen
>>>> -----------------
>>>> http://davsclaus.com @davsclaus
>>>> Camel in Action 2: https://www.manning.com/ibsen2
>>> 
>> 
>> 


Re: Unable to get Micrometer counter in Camel 3.2.0

Posted by Andrea Cosentino <an...@gmail.com>.
Open an issue please. Reporting this stuff on the mailing list will be lost.

Il mer 8 apr 2020, 17:49 Mikael Andersson Wigander <
mikael.grevsten@gmail.com> ha scritto:

> Temporarily solved by not using Camel implementation and instead use
> micrometer.io <http://micrometer.io/>, declare the bean, autowire in the
> route and use a process to count.
>
> I have tried to debug and see where it breaks but failed. Haven’t the
> deepest knowledge on the different registries that are in place here but I
> think the Camel implementation never gets registered accordingly.
>
> Thx
>
> M
>
>
> > On 8 Apr 2020, at 10:04, Mikael Andersson Wigander <
> mikael.grevsten@gmail.com> wrote:
> >
> > Thanks, I did and I can’t see anything new or significant
> >
> > Tried Timers but they doesn’t work either
> >
> > M
> >
> >> On 8 Apr 2020, at 09:17, Claus Ibsen <cl...@gmail.com> wrote:
> >>
> >> Hi
> >>
> >> Its a big upgrade, also micrometer is upgraded. So it may have changed
> >> what information it exports to JMX.
> >> Check on their project.
> >>
> >>
> >>
> >> On Wed, Apr 8, 2020 at 8:46 AM Mikael Andersson Wigander
> >> <mi...@gmail.com> wrote:
> >>>
> >>> Yes, it is added
> >>>
> >>> M
> >>>
> >>>> On 8 Apr 2020, at 08:45, Andrea Cosentino <an...@gmail.com> wrote:
> >>>>
> >>>> Did you add the camel-management dependency? Otherwise Jmx won't be
> enabled
> >>>>
> >>>> Il giorno mer 8 apr 2020 alle ore 08:43 Mikael Andersson Wigander <
> mikael.grevsten@gmail.com <ma...@gmail.com>> ha scritto:
> >>>> Hi
> >>>>
> >>>> Previously I used to run my Camel routes under 2.25.0 and with
> Micrometer component for JMX in Spring Boot 2.1.9.
> >>>>
> >>>> This route gives me a “messasges” counter in JMX to study:
> >>>>
> >>>> .to("micrometer:counter:messages")
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> But now that I upgraded to Camel 3.2.0 and Spring 2.2.6 it is not
> available in JMX anymore.
> >>>>
> >>>> Instead I get three other categories:
> >>>>
> >>>> * gauges
> >>>> * meters
> >>>> * timers
> >>>>
> >>>>
> >>>>
> >>>> Same dependencies apply and also my bean is the same
> >>>>
> >>>> @Bean(name = MicrometerConstants.METRICS_REGISTRY_NAME)
> >>>> public MeterRegistry getMeterRegistry() {
> >>>>   CompositeMeterRegistry meterRegistry = new CompositeMeterRegistry();
> >>>>   meterRegistry.add(new JmxMeterRegistry(
> >>>>       CamelJmxConfig.DEFAULT,
> >>>>       Clock.SYSTEM,
> >>>>       HierarchicalNameMapper.DEFAULT));
> >>>>
> >>>>   return meterRegistry;
> >>>> }
> >>>>
> >>>>
> >>>> Please advice
> >>>>
> >>>> Thx
> >>>>
> >>>> M
> >>>
> >>
> >>
> >> --
> >> Claus Ibsen
> >> -----------------
> >> http://davsclaus.com @davsclaus
> >> Camel in Action 2: https://www.manning.com/ibsen2
> >
>
>

Re: Unable to get Micrometer counter in Camel 3.2.0

Posted by Mikael Andersson Wigander <mi...@gmail.com>.
Temporarily solved by not using Camel implementation and instead use micrometer.io <http://micrometer.io/>, declare the bean, autowire in the route and use a process to count.

I have tried to debug and see where it breaks but failed. Haven’t the deepest knowledge on the different registries that are in place here but I think the Camel implementation never gets registered accordingly.

Thx

M


> On 8 Apr 2020, at 10:04, Mikael Andersson Wigander <mi...@gmail.com> wrote:
> 
> Thanks, I did and I can’t see anything new or significant
> 
> Tried Timers but they doesn’t work either
> 
> M
> 
>> On 8 Apr 2020, at 09:17, Claus Ibsen <cl...@gmail.com> wrote:
>> 
>> Hi
>> 
>> Its a big upgrade, also micrometer is upgraded. So it may have changed
>> what information it exports to JMX.
>> Check on their project.
>> 
>> 
>> 
>> On Wed, Apr 8, 2020 at 8:46 AM Mikael Andersson Wigander
>> <mi...@gmail.com> wrote:
>>> 
>>> Yes, it is added
>>> 
>>> M
>>> 
>>>> On 8 Apr 2020, at 08:45, Andrea Cosentino <an...@gmail.com> wrote:
>>>> 
>>>> Did you add the camel-management dependency? Otherwise Jmx won't be enabled
>>>> 
>>>> Il giorno mer 8 apr 2020 alle ore 08:43 Mikael Andersson Wigander <mikael.grevsten@gmail.com <ma...@gmail.com>> ha scritto:
>>>> Hi
>>>> 
>>>> Previously I used to run my Camel routes under 2.25.0 and with Micrometer component for JMX in Spring Boot 2.1.9.
>>>> 
>>>> This route gives me a “messasges” counter in JMX to study:
>>>> 
>>>> .to("micrometer:counter:messages")
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> But now that I upgraded to Camel 3.2.0 and Spring 2.2.6 it is not available in JMX anymore.
>>>> 
>>>> Instead I get three other categories:
>>>> 
>>>> * gauges
>>>> * meters
>>>> * timers
>>>> 
>>>> 
>>>> 
>>>> Same dependencies apply and also my bean is the same
>>>> 
>>>> @Bean(name = MicrometerConstants.METRICS_REGISTRY_NAME)
>>>> public MeterRegistry getMeterRegistry() {
>>>>   CompositeMeterRegistry meterRegistry = new CompositeMeterRegistry();
>>>>   meterRegistry.add(new JmxMeterRegistry(
>>>>       CamelJmxConfig.DEFAULT,
>>>>       Clock.SYSTEM,
>>>>       HierarchicalNameMapper.DEFAULT));
>>>> 
>>>>   return meterRegistry;
>>>> }
>>>> 
>>>> 
>>>> Please advice
>>>> 
>>>> Thx
>>>> 
>>>> M
>>> 
>> 
>> 
>> -- 
>> Claus Ibsen
>> -----------------
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
> 


Re: Unable to get Micrometer counter in Camel 3.2.0

Posted by Mikael Andersson Wigander <mi...@gmail.com>.
Thanks, I did and I can’t see anything new or significant

Tried Timers but they doesn’t work either

M

> On 8 Apr 2020, at 09:17, Claus Ibsen <cl...@gmail.com> wrote:
> 
> Hi
> 
> Its a big upgrade, also micrometer is upgraded. So it may have changed
> what information it exports to JMX.
> Check on their project.
> 
> 
> 
> On Wed, Apr 8, 2020 at 8:46 AM Mikael Andersson Wigander
> <mi...@gmail.com> wrote:
>> 
>> Yes, it is added
>> 
>> M
>> 
>>> On 8 Apr 2020, at 08:45, Andrea Cosentino <an...@gmail.com> wrote:
>>> 
>>> Did you add the camel-management dependency? Otherwise Jmx won't be enabled
>>> 
>>> Il giorno mer 8 apr 2020 alle ore 08:43 Mikael Andersson Wigander <mikael.grevsten@gmail.com <ma...@gmail.com>> ha scritto:
>>> Hi
>>> 
>>> Previously I used to run my Camel routes under 2.25.0 and with Micrometer component for JMX in Spring Boot 2.1.9.
>>> 
>>> This route gives me a “messasges” counter in JMX to study:
>>> 
>>> .to("micrometer:counter:messages")
>>> 
>>> 
>>> 
>>> 
>>> 
>>> But now that I upgraded to Camel 3.2.0 and Spring 2.2.6 it is not available in JMX anymore.
>>> 
>>> Instead I get three other categories:
>>> 
>>> * gauges
>>> * meters
>>> * timers
>>> 
>>> 
>>> 
>>> Same dependencies apply and also my bean is the same
>>> 
>>> @Bean(name = MicrometerConstants.METRICS_REGISTRY_NAME)
>>> public MeterRegistry getMeterRegistry() {
>>>    CompositeMeterRegistry meterRegistry = new CompositeMeterRegistry();
>>>    meterRegistry.add(new JmxMeterRegistry(
>>>        CamelJmxConfig.DEFAULT,
>>>        Clock.SYSTEM,
>>>        HierarchicalNameMapper.DEFAULT));
>>> 
>>>    return meterRegistry;
>>> }
>>> 
>>> 
>>> Please advice
>>> 
>>> Thx
>>> 
>>> M
>> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2


Re: Unable to get Micrometer counter in Camel 3.2.0

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Its a big upgrade, also micrometer is upgraded. So it may have changed
what information it exports to JMX.
Check on their project.



On Wed, Apr 8, 2020 at 8:46 AM Mikael Andersson Wigander
<mi...@gmail.com> wrote:
>
> Yes, it is added
>
> M
>
> > On 8 Apr 2020, at 08:45, Andrea Cosentino <an...@gmail.com> wrote:
> >
> > Did you add the camel-management dependency? Otherwise Jmx won't be enabled
> >
> > Il giorno mer 8 apr 2020 alle ore 08:43 Mikael Andersson Wigander <mikael.grevsten@gmail.com <ma...@gmail.com>> ha scritto:
> > Hi
> >
> > Previously I used to run my Camel routes under 2.25.0 and with Micrometer component for JMX in Spring Boot 2.1.9.
> >
> > This route gives me a “messasges” counter in JMX to study:
> >
> > .to("micrometer:counter:messages")
> >
> >
> >
> >
> >
> > But now that I upgraded to Camel 3.2.0 and Spring 2.2.6 it is not available in JMX anymore.
> >
> > Instead I get three other categories:
> >
> > * gauges
> > * meters
> > * timers
> >
> >
> >
> > Same dependencies apply and also my bean is the same
> >
> > @Bean(name = MicrometerConstants.METRICS_REGISTRY_NAME)
> > public MeterRegistry getMeterRegistry() {
> >     CompositeMeterRegistry meterRegistry = new CompositeMeterRegistry();
> >     meterRegistry.add(new JmxMeterRegistry(
> >         CamelJmxConfig.DEFAULT,
> >         Clock.SYSTEM,
> >         HierarchicalNameMapper.DEFAULT));
> >
> >     return meterRegistry;
> > }
> >
> >
> > Please advice
> >
> > Thx
> >
> > M
>


-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Unable to get Micrometer counter in Camel 3.2.0

Posted by Mikael Andersson Wigander <mi...@gmail.com>.
I can see in debug output it is registered

2020-04-08 09:11:57.086 DEBUG 68795 --- [  restartedMain] o.a.c.impl.engine.AbstractCamelContext   : Using ComponentResolver: org.apache.camel.impl.engine.DefaultComponentResolver@2c311daa to resolve component with name: micrometer
2020-04-08 09:11:57.086 DEBUG 68795 --- [  restartedMain] org.apache.camel.support.ResolverHelper  : Lookup Component with name micrometer in registry. Found: null
2020-04-08 09:11:57.086 DEBUG 68795 --- [  restartedMain] org.apache.camel.support.ResolverHelper  : Lookup Component with name micrometer-component in registry. Found: null
2020-04-08 09:11:57.086 DEBUG 68795 --- [  restartedMain] o.a.c.i.engine.DefaultComponentResolver  : Found component: micrometer via type: org.apache.camel.component.micrometer.MicrometerComponent via: META-INF/services/org/apache/camel/component/micrometer
2020-04-08 09:11:57.088 DEBUG 68795 --- [  restartedMain] o.a.c.i.e.DefaultConfigurerResolver      : Found configurer: micrometer-component via type: org.apache.camel.component.micrometer.MicrometerComponentConfigurer via: META-INF/services/org/apache/camel/configurer/micrometer-component
2020-04-08 09:11:57.089 DEBUG 68795 --- [  restartedMain] o.a.c.i.e.DefaultConfigurerResolver      : Found configurer: micrometer-endpoint via type: org.apache.camel.component.micrometer.MicrometerEndpointConfigurer via: META-INF/services/org/apache/camel/configurer/micrometer-endpoint
2020-04-08 09:11:57.090 DEBUG 68795 --- [  restartedMain] o.apache.camel.support.DefaultComponent  : Creating endpoint uri=[micrometer://counter:messages], path=[counter:messages]
2020-04-08 09:11:57.090 DEBUG 68795 --- [  restartedMain] o.a.c.c.micrometer.MicrometerUtils       : Looking up MeterRegistry from Camel Registry for name "metricsRegistry"
2020-04-08 09:11:57.090 DEBUG 68795 --- [  restartedMain] o.a.c.c.micrometer.MicrometerUtils       : MeterRegistry not found from Camel Registry for name "metricsRegistry"
2020-04-08 09:11:57.090  INFO 68795 --- [  restartedMain] o.a.c.c.micrometer.MicrometerUtils       : Creating new default MeterRegistry
2020-04-08 09:11:57.092 DEBUG 68795 --- [  restartedMain] o.a.c.c.micrometer.MicrometerComponent   : Metrics type: COUNTER; name: messages; tags: []
2020-04-08 09:11:57.093 DEBUG 68795 --- [  restartedMain] o.a.c.impl.engine.AbstractCamelContext   : micrometer://counter:messages converted to endpoint: micrometer://counter:messages by component: org.apache.camel.component.micrometer.MicrometerComponent@3e078d50

> On 8 Apr 2020, at 08:46, Mikael Andersson Wigander <mi...@gmail.com> wrote:
> 
> Yes, it is added
> 
> M
> 
>> On 8 Apr 2020, at 08:45, Andrea Cosentino <ancosen@gmail.com <ma...@gmail.com>> wrote:
>> 
>> Did you add the camel-management dependency? Otherwise Jmx won't be enabled
>> 
>> Il giorno mer 8 apr 2020 alle ore 08:43 Mikael Andersson Wigander <mikael.grevsten@gmail.com <ma...@gmail.com>> ha scritto:
>> Hi
>> 
>> Previously I used to run my Camel routes under 2.25.0 and with Micrometer component for JMX in Spring Boot 2.1.9.
>> 
>> This route gives me a “messasges” counter in JMX to study:
>> 
>> .to("micrometer:counter:messages")
>> 
>> 
>> 
>> 
>> 
>> But now that I upgraded to Camel 3.2.0 and Spring 2.2.6 it is not available in JMX anymore.
>> 
>> Instead I get three other categories:
>> 
>> * gauges
>> * meters
>> * timers
>> 
>> 
>> 
>> Same dependencies apply and also my bean is the same
>> 
>> @Bean(name = MicrometerConstants.METRICS_REGISTRY_NAME)
>> public MeterRegistry getMeterRegistry() {
>>     CompositeMeterRegistry meterRegistry = new CompositeMeterRegistry();
>>     meterRegistry.add(new JmxMeterRegistry(
>>         CamelJmxConfig.DEFAULT,
>>         Clock.SYSTEM,
>>         HierarchicalNameMapper.DEFAULT));
>> 
>>     return meterRegistry;
>> }
>> 
>> 
>> Please advice
>> 
>> Thx
>> 
>> M
> 


Re: Unable to get Micrometer counter in Camel 3.2.0

Posted by Mikael Andersson Wigander <mi...@gmail.com>.
Yes, it is added

M

> On 8 Apr 2020, at 08:45, Andrea Cosentino <an...@gmail.com> wrote:
> 
> Did you add the camel-management dependency? Otherwise Jmx won't be enabled
> 
> Il giorno mer 8 apr 2020 alle ore 08:43 Mikael Andersson Wigander <mikael.grevsten@gmail.com <ma...@gmail.com>> ha scritto:
> Hi
> 
> Previously I used to run my Camel routes under 2.25.0 and with Micrometer component for JMX in Spring Boot 2.1.9.
> 
> This route gives me a “messasges” counter in JMX to study:
> 
> .to("micrometer:counter:messages")
> 
> 
> 
> 
> 
> But now that I upgraded to Camel 3.2.0 and Spring 2.2.6 it is not available in JMX anymore.
> 
> Instead I get three other categories:
> 
> * gauges
> * meters
> * timers
> 
> 
> 
> Same dependencies apply and also my bean is the same
> 
> @Bean(name = MicrometerConstants.METRICS_REGISTRY_NAME)
> public MeterRegistry getMeterRegistry() {
>     CompositeMeterRegistry meterRegistry = new CompositeMeterRegistry();
>     meterRegistry.add(new JmxMeterRegistry(
>         CamelJmxConfig.DEFAULT,
>         Clock.SYSTEM,
>         HierarchicalNameMapper.DEFAULT));
> 
>     return meterRegistry;
> }
> 
> 
> Please advice
> 
> Thx
> 
> M


Re: Unable to get Micrometer counter in Camel 3.2.0

Posted by Andrea Cosentino <an...@gmail.com>.
Did you add the camel-management dependency? Otherwise Jmx won't be enabled

Il giorno mer 8 apr 2020 alle ore 08:43 Mikael Andersson Wigander <
mikael.grevsten@gmail.com> ha scritto:

> Hi
>
> Previously I used to run my Camel routes under 2.25.0 and with Micrometer
> component for JMX in Spring Boot 2.1.9.
>
> This route gives me a “messasges” counter in JMX to study:
>
> .to("micrometer:counter:messages")
>
>
>
>
>
>
> But now that I upgraded to Camel 3.2.0 and Spring 2.2.6 it is not
> available in JMX anymore.
>
> Instead I get three other categories:
>
> * gauges
> * meters
> * timers
>
>
> Same dependencies apply and also my bean is the same
>
> @Bean(name = MicrometerConstants.METRICS_REGISTRY_NAME)
> public MeterRegistry getMeterRegistry() {
>     CompositeMeterRegistry meterRegistry = new CompositeMeterRegistry();
>     meterRegistry.add(new JmxMeterRegistry(
>         CamelJmxConfig.DEFAULT,
>         Clock.SYSTEM,
>         HierarchicalNameMapper.DEFAULT));
>
>     return meterRegistry;
> }
>
>
>
> Please advice
>
> Thx
>
> M
>