I would be thankful for any kind of suggestions regarding a camel-metrics issue. I am using camel spring DSL + prometheus + camel metrics.
Camel context:
<bean id="policy" class="org.apache.camel.component.metrics.routepolicy.MetricsRoutePolicy" >
<property name="useJmx" value="true"/>
<property name="jmxDomain" value="custom_metrics"/>
</bean>
...
...
<route id="myRoute" routePolicyRef="policy">
<from uri="direct:myOriginalRoute"/>
<setExchangePattern pattern="InOnly"/>
<to uri="metrics:counter:simple.counter" />
</route>
Prometheus config:
startDelaySecs: 10
ssl: false
lowercaseOutputName: true
lowercaseOutputLabelNames: true
Console output:
2018-04-17 13:11:20,306 | INFO | 8]-nio2-thread-7 | ServerSession
| 177 - org.apache.sshd.core - 0.14.0 | Server session created from
/127.0.0.1:56828
2018-04-17 13:11:39,831 | INFO | orter-1-thread-1 | MetricsComponent
| 60 - org.apache.camel.camel-metrics - 2.15.0 | type=COUNTER,
name=simple.counter, count=7
So, as you can see, the metrics in my route is working, counting as expected ("7"). But in the exported Json, the value is incorrect: "1.0". However the JVM specific metrics are there, the custom metrics name too, only my custom metrics value is missing.
exported JSON (curl localhost:5050/metrics):
jvm_memory_pool_bytes_max{pool="Code Cache",} 2.5165824E8
jvm_memory_pool_bytes_max{pool="Metaspace",} -1.0
jvm_memory_pool_bytes_max{pool="Compressed Class Space",} 1.073741824E9
jvm_memory_pool_bytes_max{pool="PS Eden Space",} 8.50395136E8
jvm_memory_pool_bytes_max{pool="PS Survivor Space",} 1.0747904E8
jvm_memory_pool_bytes_max{pool="PS Old Gen",} 2.147483648E9
...
...
org_apache_camel_mycomponent_singleton{type="endpoints",
name="\"metrics://counter:simple.counter\"",} 1.0
Any idea? Thanks!