Right now indicator values and all other metrics gathered to a report in same thread.
Given example can lead to blocking whole reporting subsystem:
profiler.attachIndicator("my-blockable-indicator", ()->{
jdbc.execute("query that can block for a long time")
})
Suggestion:
- Create separate thread pool that gathers indicators values and if it block, it will not affect whole aggregating profiler.
- Add ability to set value to indicator without callbacks:
profiler.setIndicatorValue("my-indicator", 144)