Hi Ivan, nice job with this example.

I found another potential issue with the metrics in TomEE, If you remove
the `monotonic = true` from the @Counted annotation, then the format of the
endpoint: http://localhost:8080/rest-mp-metrics/metrics is no longer
Prometheus but JSON instead.


Without `monotonic = true`

{"application":{"message_counter":0},"vendor":{"startTime":1542679115312},"base":{"classloader.totalLoadedClass.count":8971,"thread.count":39,"classloader.currentLoadedClass.count":8971,"jvm.uptime":103050,"gc.PS
MarkSweep.count":2,"thread.max.count":39,"memory.committedHeap":369098752,"gc.PS
Scavenge.count":7,"cpu.availableProcessors":4,"thread.daemon.count":38,"classloader.totalUnloadedClass.count":8971,"memory.maxHeap":3817865216,"memory.usedHeap":69535960,"gc.PS
MarkSweep.time":141,"gc.PS Scavenge.time":103}}



With `monotonic = true`

# TYPE application:message_counter counter
application:message_counter 0.0
# TYPE base:classloader_total_loaded_class_count counter
base:classloader_total_loaded_class_count 8839.0
# TYPE base:thread_count counter
base:thread_count 39.0
# TYPE base:classloader_current_loaded_class_count counter
base:classloader_current_loaded_class_count 8847.0
# TYPE base:jvm_uptime_seconds gauge
base:jvm_uptime_seconds 0.006427
# TYPE base:gc_ps_mark_sweep_count counter
base:gc_ps_mark_sweep_count 2.0
# TYPE base:gc_ps_scavenge_count counter
base:gc_ps_scavenge_count 7.0
# TYPE base:memory_committed_heap_bytes gauge
base:memory_committed_heap_bytes 3.70147328E8
# TYPE base:thread_max_count counter
base:thread_max_count 39.0
# TYPE base:cpu_available_processors gauge
base:cpu_available_processors 4.0
# TYPE base:thread_daemon_count counter
base:thread_daemon_count 38.0
# TYPE base:classloader_total_unloaded_class_count counter
base:classloader_total_unloaded_class_count 8847.0
# TYPE base:memory_max_heap_bytes gauge
base:memory_max_heap_bytes 3.817865216E9
# TYPE base:gc_ps_mark_sweep_time_seconds gauge
base:gc_ps_mark_sweep_time_seconds 1.19E-4
# TYPE base:memory_used_heap_bytes gauge
base:memory_used_heap_bytes 6.7481504E7
# TYPE base:gc_ps_scavenge_time_seconds gauge
base:gc_ps_scavenge_time_seconds 1.09E-4
# TYPE vendor:start_time counter
vendor:start_time 1.542679428814E12


This is not stated on the MP metrics spec. So I wonder if TomEE should
provide a set of properties to avoid these random behaviors.


El lun., 19 nov. 2018 a las 13:51, Ivan Junckes Filho (<
ivanjunc...@gmail.com>) escribió:

> Hey guys, just to let you know that I created a Microprofile Metrics
> Example under Tomee.
>
> I am still working on that and I will provide more test scenarios.
>
> Here is the PR if you want to review the work so far:
> https://github.com/apache/tomee/pull/203
>
> Feel free to merge if you think this can be done incrementally.
>


-- 
Atentamente:
César Hernández Mendoza.

Reply via email to