apache / incubator-kie-kogito-runtimes

Kogito Runtimes - Kogito is a cloud-native business automation technology for building cloud-ready business applications.
http://kogito.kie.org
Apache License 2.0
491 stars 192 forks source link

Add node duration metric to monitoring addon #3483

Closed fjtirado closed 2 months ago

fjtirado commented 2 months ago

Description

It would be interesting to track the duration of certain nodes, as we are tracking process instances duration and all work items duration

Implementation ideas

In BPMN and SWF parsers, add a metadata key called "Metric" to those nodes that it will be interesting to track duration for. In monitoring addon, add a new Distributionsummary object called ""kogito_node_instance_duration_seconds" which will record duration for those nodes flagged with the metadata key.

fjtirado commented 2 months ago

@elguardian Should I change the BPMN parser to add the metric metadata to certain nodes (in that case we need to dicuss which ones) or do you prefer to do that with a follow up issue?

elguardian commented 2 months ago

there is no need to change the parsec... the editor has already a metadata section. so you just need to take that into account in the runtime

fjtirado commented 2 months ago

there is no need to change the parsec... the editor has already a metadata section. so you just need to take that into account in the runtime

Sure, I mean, add to the parser logic a call to nodefactory.metadata ("metric", "node name as it should appear in metric tag") for those nodes which duration should be recorded

elguardian commented 2 months ago

the metadata is added automatically in the visitor. you don't need to do anything special