2

Small question regarding how to build Grafana dashboards which separates "boundedElastic" vs "parallel" please.

Currently with a Spring Webflux app, I get out of the box very useful metrics for Reactor Core.

executor_pool_size_threads
executor_pool_core_threads
executor_pool_max_threads

etc

The Reactor Team even provides default dashboard so we can have visuals on the states:

https://github.com/reactor/reactor-monitoring-demo

Unfortunately, the current dashboards mix "boundedElastic" and "parallel", I am trying to build the same dashboards, but with "boundedElastic" and "parallel" separated.

I tried:

sum(executor_pool_size_threads{_ws_="my_workspace"}) by (reactor_scheduler_id, boundedElastic)

But no luck so far. May I ask what is the correct way to do it please? Thank you

PatPanda
  • 3,644
  • 9
  • 58
  • 154

1 Answers1

2

In the demo project, the metrics are stored in Prometheus and are queried using PromQL. Each metric can have several labels and each label can have several values. The metrics can be selected by labels and values, e.g. my_metric{first_label="first_value", second_label="another_value"} selects my_metric where both labels are matching corresponding values.

So in your example the metric executor_pool_size_threads has the label reactor_scheduler_id. However, the values contain more information beyond scheduler name. On my machine (because of default pool size) the values are: parallel(8,"parallel") and boundedElastic("boundedElastic",maxThreads=80,maxTaskQueuedPerThread=100000,ttl=60s). So regex-match is useful here for matching the values with =~ operator.

PromQL query only for parallel:

sum (executor_pool_size_threads{reactor_scheduler_id=~"parallel.*"}) by (reactor_scheduler_id)

PromQL query only for boundedElastic:

sum (executor_pool_size_threads{reactor_scheduler_id=~"boundedElastic.*"}) by (reactor_scheduler_id)
gindex
  • 285
  • 1
  • 11