Hi Steven,

I’m about to write a quick blog post to give some highlights about this change.

Basically, I did these two other changes:

1. For « descendent » properties (the properties inside a Map for instance), 
the property is now named [MAP_PROPERTY]_[ENTRY_PROPERTY]:

https://github.com/apache/karaf-decanter/blob/main/appender/prometheus/src/main/java/org/apache/karaf/decanter/appender/prometheus/PrometheusServlet.java#L74

2. You can specify the property you want to « render » in the Prometheus 
servlet using prometheus.key.foo in 
etc/org.apache.karaf.decanter.appender.prometheus.cfg:

https://github.com/apache/karaf-decanter/blob/main/appender/prometheus/src/main/java/org/apache/karaf/decanter/appender/prometheus/PrometheusServlet.java#L69

I hope it helps.

Regards
JB

> Le 19 sept. 2021 à 10:16, Steven Huypens <[email protected]> a écrit :
> 
> Hi JB,
> 
> I've tested the new 2.8.0 decanter release and I'm pleased to say your fix 
> for https://issues.apache.org/jira/browse/KARAF-7154 works great. Thanks for 
> that !
> 
> However I couldn't figure out from the pull request what changes you made 
> related to my second suggestion, to better identify from which MBean the 
> properties are (or as you put it 'allow user to define the "exported" event 
> properties by configuration'). Can you please explain how I can achieve this ?
> 
> Kind regards,
> Steven
> 
> On Wed, May 12, 2021 at 6:57 PM Steven Huypens <[email protected]> 
> wrote:
> Hi Jean-Baptist,
> 
> 1) You mention the Prometheus appender only exposes the numeric metrics. I 
> believe it would be a minor but very useful addition to also expose the 
> Objects in a CompositeDataSupport. For example java.lang.memory has a 
> HeapMemoryUsage-object which contains 4 values (committed, init, max & used) 
> that could easily be exposed as well.
> 
> 2) I also would like to suggest to prefix the outputted name of a property 
> with something that really identifies the MBean, eg. :
> 
> java_lang_Memory_HeapMemoryUsage_committed
> java_lang_Memory_HeapMemoryUsage_init 
> java_lang_Memory_HeapMemoryUsage_max
> java_lang_Memory_HeapMemoryUsage_used
> 
> Currently MBeans having the same properties will have their values overridden 
> in the output.
> 
> Kind regards,
> Steven
> 
> On Mon, May 3, 2021 at 6:14 AM Jean-Baptiste Onofre <[email protected]> wrote:
> Hi Daniel,
> 
> JMX collector polls all MBeans attributes. However Prometheus appender only 
> expose metrics (numeric) on the Prometheus servlet:
> 
> http://localhost:8181/decanter/prometheus
> 
> As the generated JMX JSON is "more" than just numeric, it’s possible that you 
> don’t have the metrics.
> 
> You can check the JMX JSON using another kind of appender (like log appender 
> or elasticsearch).
> I can add kind of "json introspection" on the Prometheus appender to "force" 
> some JSON fields as metrics (gauge).
> 
> Regards
> JB
> 
> > Le 2 mai 2021 à 22:24, Daniel Las <[email protected]> a écrit :
> > 
> > Hi,
> > 
> > I installed Decanter 2.7.0 on Karaf 4.2.11 with JMX collector and 
> > Prometheus appender features. I uncommented 
> > "object.name.system=java.lang:*" in 
> > org.apache.karaf.decanter.collector.jmx-local.cfg.
> > 
> > Where can I find JVM metrics like current heap memory usage? 
> > 
> > Regards
> > -- 
> > Daniel Łaś
> > 
> 

Reply via email to