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

   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.
   
   WDYT? @ruanwenjun  


-- 
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