File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
pkg/epp/flowcontrol/controller/internal Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -211,16 +211,19 @@ func (sp *ShardProcessor) Run(ctx context.Context) {
211211// It handles capacity checks, checks for external finalization, and either admits the item to a queue or rejects it.
212212func (sp * ShardProcessor ) enqueue (item * FlowItem ) {
213213
214- outcome := item .FinalState ()
215214 req := item .OriginalRequest ()
216215 key := req .FlowKey ()
217216 priorityStr := strconv .Itoa (key .Priority )
217+ outcome := item .FinalState ()
218218
219219 startTime := time .Now ()
220220
221221 defer func () {
222- metrics .RecordFlowControlRequestEnqueueDuration (priorityStr , outcome .Outcome .String (), time .Since (startTime ))
223-
222+ outcomeStr := "NotYetFinalized"
223+ if fs := item .FinalState (); fs != nil {
224+ outcomeStr = fs .Outcome .String ()
225+ }
226+ metrics .RecordFlowControlRequestEnqueueDuration (priorityStr , outcomeStr , time .Since (startTime ))
224227 }()
225228
226229 // --- Optimistic External Finalization Check ---
You can’t perform that action at this time.
0 commit comments