Skip to content

Commit

Permalink
Revert "fix: should emit realtime metrics in every execution"
Browse files Browse the repository at this point in the history
This reverts commit d741add.
  • Loading branch information
fyp711 committed Aug 15, 2024
1 parent 41fef45 commit c86bbda
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions workflow/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -2248,8 +2248,12 @@ func (woc *wfOperationCtx) executeTemplate(ctx context.Context, nodeName string,
}

if processedTmpl.Metrics != nil {
localScope, realTimeScope := woc.prepareMetricScope(node)
woc.computeMetrics(processedTmpl.Metrics.Prometheus, localScope, realTimeScope, true)
// Check if the node was just created, if it was emit realtime metrics.
// If the node did not previously exist, we can infer that it was created during the current operation, emit real time metrics.
if _, ok := woc.preExecutionNodePhases[node.ID]; !ok {
localScope, realTimeScope := woc.prepareMetricScope(node)
woc.computeMetrics(processedTmpl.Metrics.Prometheus, localScope, realTimeScope, true)
}
// Check if the node completed during this execution, if it did emit metrics
//
// This check is necessary because sometimes a node will be marked completed during the current execution and will
Expand Down

0 comments on commit c86bbda

Please sign in to comment.