EricGao888 commented on issue #10525:
URL: 
https://github.com/apache/dolphinscheduler/issues/10525#issuecomment-1169747224

   > It seems `micrometer` will not automatically manage those 
dynamically-generated metrics for us.
   > 
   > First of all, we may use constant name and dynamic tags, e.g. workflow_id 
to generate metrics dynamically.
   > 
   > Secondly, I plan to use a class `DynamicMetricsManager` to provide a 
method to instantiate metrics during runtime. `DynamicMetricsManager` uses 
`ConcurrentHashMap` to store those dynamic metrics.
   > 
   > Thirdly, when workflow / task instance finished, `DynamicMetricsManager` 
will remove related metrics from `ConcurrentHashMap` and put them into 
`Caffeine Cache` with `expireAfterAcess` larger than `Prometheus` pull interval 
to manage the life cycle of those dynamic metrics and avoid memory explosion.
   > 
   > WDYT? @ruanwenjun
   
   I think there could be a better solution.
   
   We give users ability to choose whether monitor a specific workflow or not 
on UI. DS will generate related metrics for a specific workflow only if users 
choose to. This is more reasonable because users definitely do not need to 
monitor every workflow / task in detail. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to