File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -460,6 +460,15 @@ impl ContextStack {
460460 // The empty context is always at the bottom of the [`ContextStack`]
461461 // and cannot be popped, and the overflow position is invalid, so do
462462 // nothing.
463+ otel_warn ! (
464+ name: "Context.PopInvalidPosition" ,
465+ position = pos,
466+ message = if pos == ContextStack :: BASE_POS {
467+ "Attempted to pop the base context which is not allowed"
468+ } else {
469+ "Attempted to pop the overflow position which is not allowed"
470+ }
471+ ) ;
463472 return ;
464473 }
465474 let len: u16 = self . stack . len ( ) as u16 ;
@@ -479,6 +488,12 @@ impl ContextStack {
479488 // This is an out of order pop.
480489 if pos >= len {
481490 // This is an invalid id, ignore it.
491+ otel_warn ! (
492+ name: "Context.PopOutOfBounds" ,
493+ position = pos,
494+ stack_length = len,
495+ message = "Attempted to pop beyond the end of the context stack"
496+ ) ;
482497 return ;
483498 }
484499 // Clear out the entry at the given id.
You can’t perform that action at this time.
0 commit comments